? core.15570
? core.16472
? log
? docs/version.entities
? ext/ffmpeg/core.4962
? ext/ffmpeg/log
Index: ext/ffmpeg/gstffmpegdec.c
===================================================================
RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdec.c,v
retrieving revision 1.139
diff -u -r1.139 gstffmpegdec.c
--- ext/ffmpeg/gstffmpegdec.c	6 Feb 2006 17:51:41 -0000	1.139
+++ ext/ffmpeg/gstffmpegdec.c	13 Feb 2006 12:52:45 -0000
@@ -35,7 +35,7 @@
 #include "gstffmpeg.h"
 #include "gstffmpegcodecmap.h"
 
-//#define FORCE_OUR_GET_BUFFER
+#define FORCE_OUR_GET_BUFFER
 
 typedef struct _GstFFMpegDec GstFFMpegDec;
 
@@ -553,6 +553,7 @@
 {
   GstBuffer *buf = NULL;
   gulong bufsize = 0;
+  GstFlowReturn res;
   GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) context->opaque;
   int width = context->width;
   int height = context->height;
@@ -584,9 +585,12 @@
         return avcodec_default_get_buffer (context, picture);
       }
 
-      if (gst_pad_alloc_buffer_and_set_caps (ffmpegdec->srcpad, GST_BUFFER_OFFSET_NONE,
-              bufsize, GST_PAD_CAPS (ffmpegdec->srcpad), &buf) != GST_FLOW_OK)
-        return -1;
+      res = gst_pad_alloc_buffer_and_set_caps (ffmpegdec->srcpad, GST_BUFFER_OFFSET_NONE,
+					       bufsize, GST_PAD_CAPS (ffmpegdec->srcpad), &buf);
+      if (res != GST_FLOW_OK) {
+ 	buf = gst_buffer_new_and_alloc (bufsize);
+ 	gst_buffer_set_caps (buf, GST_PAD_CAPS (ffmpegdec->srcpad));
+      }
       ffmpegdec->last_buffer = buf;
 
       gst_ffmpeg_avpicture_fill ((AVPicture *) picture,
@@ -600,6 +604,8 @@
       break;
   }
 
+  GST_LOG_OBJECT (ffmpegdec, "Created buffer %p", buf);
+
   /* tell ffmpeg we own this buffer
    *
    * we also use an evil hack (keep buffer in base[0])
@@ -623,11 +629,12 @@
   GstBuffer *buf;
   GstFFMpegDec *ffmpegdec = (GstFFMpegDec *) context->opaque;
 
-  g_return_if_fail (buf != NULL);
   g_return_if_fail (picture->type == FF_BUFFER_TYPE_USER);
 
   buf = GST_BUFFER (picture->opaque);
 
+  g_return_if_fail (buf != NULL);
+
   if (buf == ffmpegdec->last_buffer)
     ffmpegdec->last_buffer = NULL;
   gst_buffer_unref (buf);
