felipec gst-openmax: gst-openmax/omx/

[email protected]
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-openmax
Changes by:     felipec
Date:           Thu Nov 20 2008  17:16:42 UTC

Log message:
Fix seeking when using zero-copy.
When doing seeking, and other times, a pad push returns an error and if
zero-copy is enabled the omx buffer doesn't have any allocated buffer.
So allocate the buffer so omx doesn't crash.

Modified files:
    omx             : gstomx_base_filter.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-openmax/omx/gstomx_base_filter.c.diff?r1=1.67&r2=1.68

====Begin Diffs====
Index: gstomx_base_filter.c
===================================================================
RCS file: /cvs/gstreamer/gst-openmax/omx/gstomx_base_filter.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- gstomx_base_filter.c	20 Nov 2008 17:07:57 -0000	1.67
+++ gstomx_base_filter.c	20 Nov 2008 17:16:28 -0000	1.68
@@ -272,7 +272,6 @@
     GOmxPort *out_port;
     GstOmxBaseFilter *self;
     GstFlowReturn ret = GST_FLOW_OK;
-    OMX_BUFFERHEADERTYPE *omx_buffer = NULL;
 
     pad = data;
     self = GST_OMX_BASE_FILTER (gst_pad_get_parent (pad));
@@ -290,6 +289,8 @@
     if (G_LIKELY (out_port->enabled))
     {
+        OMX_BUFFERHEADERTYPE *omx_buffer = NULL;
+
         GST_LOG_OBJECT (self, "request buffer");
         omx_buffer = g_omx_port_request_buffer (out_port);
@@ -395,9 +396,6 @@
             GST_WARNING_OBJECT (self, "empty buffer");
         }
-        if (G_UNLIKELY (ret != GST_FLOW_OK))
-            goto leave;
-
         if (G_UNLIKELY (omx_buffer->nFlags & OMX_BUFFERFLAG_EOS))
         {
             GST_DEBUG_OBJECT (self, "got eos");
@@ -439,17 +437,14 @@
             GST_ERROR_OBJECT (self, "no input buffer to share");
-    }
-leave:
-    if (omx_buffer)
-    {
         omx_buffer->nFilledLen = 0;
         GST_LOG_OBJECT (self, "release_buffer");
         g_omx_port_release_buffer (out_port, omx_buffer);
     }
+leave:
     self->last_pad_push_return = ret;
     if (ret != GST_FLOW_OK)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.