diff --git a/ChangeLog b/ChangeLog index 144a63cdb7..1317a1a78e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-03-14 Tim-Philipp Müller + + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame): + Don't use gst_pad_alloc_buffer() for frames with palette, + as we'll artificially shorten the size of buffers in that + case and GstBaseTransform will complain about unit size + issues if we use _alloc_buffer() with the full size. + 2006-03-01 Michal Benes Reviewed by : Edward Hervey diff --git a/common b/common index c09cd18d32..9200457d08 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit c09cd18d328f740ac532377fa5605b0f712cc6fd +Subproject commit 9200457d08a57f0d7eaeb56915804fa8faf14418 diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 63c3c2ac5c..1bfd43f366 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -897,12 +897,21 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, if (!gst_ffmpegdec_negotiate (ffmpegdec)) return -1; - if ((*ret = - gst_pad_alloc_buffer_and_set_caps (ffmpegdec->srcpad, - GST_BUFFER_OFFSET_NONE, fsize, - GST_PAD_CAPS (ffmpegdec->srcpad), - &outbuf)) != GST_FLOW_OK) - return -1; + if (!ffmpegdec->context->palctrl) { + if ((*ret = + gst_pad_alloc_buffer_and_set_caps (ffmpegdec->srcpad, + GST_BUFFER_OFFSET_NONE, fsize, + GST_PAD_CAPS (ffmpegdec->srcpad), + &outbuf)) != GST_FLOW_OK) + return -1; + } else { + /* for paletted data we can't use pad_alloc_buffer(), because + * fsize contains the size of the palette, so the overall size + * is bigger than ffmpegcolorspace's unit size, which will + * prompt GstBaseTransform to complain endlessly ... */ + outbuf = gst_buffer_new_and_alloc (fsize); + gst_buffer_set_caps (outbuf, GST_PAD_CAPS (ffmpegdec->srcpad)); + } /* original ffmpeg code does not handle odd sizes correctly. * This patched up version does */