[gstreamer-bugs] [Bug 601501] [ffdec_vc1] Fails to decode some VC1 streams that work with mplayer
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Wed Nov 11 10:48:21 PST 2009
https://bugzilla.gnome.org/show_bug.cgi?id=601501
GStreamer | gst-ffmpeg | 0.10.x
Jan Schmidt <thaytan> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |thaytan at mad.scientist.com
--- Comment #2 from Jan Schmidt <thaytan at mad.scientist.com> 2009-11-11 18:48:20 UTC ---
This patch I made a while back fixes it, but breaks some other cases, which is
why I didn't push it yet:
commit a424c27c5e3c5aa0c161d0d6116b86c1d801e0f4
Author: Jan Schmidt <thaytan at noraisin.net>
Date: Thu Oct 1 02:48:35 2009 +0100
ffmpeg: VC-1/WMV3 fixes.
Use format field in the pad caps to differentiate VC-1 from WMV3.
Add a different dodgy hack to populate the extradata size field
(first byte) when it is 0 - as it seems to be for some test files.
diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c
index 584be8e..bb5ee6b 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.c
+++ b/ext/ffmpeg/gstffmpegcodecmap.c
@@ -965,11 +965,12 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_WMV3:
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-wmv",
- "wmvversion", G_TYPE_INT, 3, NULL);
+ "wmvversion", G_TYPE_INT, 3, "format", GST_TYPE_FOURCC,
+ GST_MAKE_FOURCC ('W', 'M', 'V', '3'), NULL);
break;
case CODEC_ID_VC1:
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-wmv",
- "wmvversion", G_TYPE_INT, 3, "fourcc", GST_TYPE_FOURCC,
+ "wmvversion", G_TYPE_INT, 3, "format", GST_TYPE_FOURCC,
GST_MAKE_FOURCC ('W', 'V', 'C', '1'), NULL);
break;
case CODEC_ID_QDM2:
@@ -2156,6 +2157,11 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
context->extradata_size = size;
}
+ /* Hack for VC1. Sometimes the first (length) byte is 0 for some files */
+ if (codec_id == CODEC_ID_VC1 && size > 0 && data[0] == 0) {
+ context->extradata[0] = (guint8) size;
+ }
+
GST_DEBUG ("have codec data of size %d", size);
} else if (context->extradata == NULL) {
/* no extradata, alloc dummy with 0 sized, some codecs insist on reading
@@ -2716,7 +2722,7 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps,
AVCodecContext * context)
{
guint32 fourcc;
- if (gst_structure_get_fourcc (structure, "fourcc", &fourcc)) {
+ if (gst_structure_get_fourcc (structure, "format", &fourcc)) {
if ((fourcc == GST_MAKE_FOURCC ('W', 'V', 'C', '1')) ||
(fourcc == GST_MAKE_FOURCC ('W', 'M', 'V', 'A')))
id = CODEC_ID_VC1;
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the Gstreamer-bugs
mailing list