ext/ffmpeg/gstffmpegdec.c: Don't use gst_pad_alloc_buffer() for frames with palette, as we'll artificially shorten th...

Original commit message from CVS:
* 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.
This commit is contained in:
Tim-Philipp Müller 2006-03-14 17:49:34 +00:00
parent 1b5a9e3fca
commit fd380cb847
3 changed files with 24 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2006-03-14 Tim-Philipp Müller <tim at centricular dot net>
* 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 <michal dot benes at xeris dot cz>
Reviewed by : Edward Hervey <edward@fluendo.com>

2
common

@ -1 +1 @@
Subproject commit c09cd18d328f740ac532377fa5605b0f712cc6fd
Subproject commit 9200457d08a57f0d7eaeb56915804fa8faf14418

View file

@ -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 */