diff --git a/ChangeLog b/ChangeLog index 0922430413..0648375243 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-06-30 Sebastian Dröge + + * gst/ffmpegcolorspace/gstffmpegcodecmap.c: + (gst_ffmpeg_pixfmt_to_caps): + * gst/ffmpegcolorspace/gstffmpegcolorspace.c: + (gst_ffmpegcsp_get_unit_size): + Only set/get on the PAL8 format, ffmpegcolorspace doesn't support + it on other formats. Also adjust the unit size only for that format + to not include the palette. Fixes bug #540497. + 2008-06-29 Stefan Kost * gst/adder/gstadder.c: diff --git a/gst/ffmpegcolorspace/gstffmpegcodecmap.c b/gst/ffmpegcolorspace/gstffmpegcodecmap.c index 9d32221ef2..1d43664835 100644 --- a/gst/ffmpegcolorspace/gstffmpegcodecmap.c +++ b/gst/ffmpegcolorspace/gstffmpegcodecmap.c @@ -390,7 +390,7 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context) "bpp", G_TYPE_INT, bpp, "depth", G_TYPE_INT, depth, "endianness", G_TYPE_INT, endianness, NULL); - if (context) { + if (context && context->pix_fmt == PIX_FMT_PAL8) { gst_ffmpeg_set_palette (caps, context); } } diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index dda50a78c5..bc71ef8e77 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -412,7 +412,8 @@ gst_ffmpegcsp_get_unit_size (GstBaseTransform * btrans, GstCaps * caps, * GStreamer currently puts it into the caps as 'palette_data' field, * so for paletted data the frame size avpicture_get_size() returns is * 1024 bytes larger than what GStreamer expects. */ - if (gst_structure_has_field (structure, "palette_data")) { + if (gst_structure_has_field (structure, "palette_data") && + ctx->pix_fmt == PIX_FMT_PAL8) { *size -= 4 * 256; /* = AVPALETTE_SIZE */ }