From 97015d3c93e26f6e5522fbd70b3f26d300cb71ef Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Tue, 25 Jun 2013 21:16:38 +0200 Subject: [PATCH] flvdemux: Add flvversion 1 to the flash-video caps This allows using avdec_flv which requires this field to be present in the caps. FLV only supports flash-video version 1 right now. https://bugzilla.gnome.org/show_bug.cgi?id=703076 --- gst/flv/gstflvdemux.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c index b5a7af97ec..0e166bc75d 100644 --- a/gst/flv/gstflvdemux.c +++ b/gst/flv/gstflvdemux.c @@ -76,7 +76,7 @@ static GstStaticPadTemplate video_src_template = GST_STATIC_PAD_TEMPLATE ("video", GST_PAD_SRC, GST_PAD_SOMETIMES, - GST_STATIC_CAPS ("video/x-flash-video; " + GST_STATIC_CAPS ("video/x-flash-video, flvversion=(int) 1; " "video/x-flash-screen; " "video/x-vp6-flash; " "video/x-vp6-alpha; " "video/x-h264, stream-format=avc;") @@ -1183,7 +1183,9 @@ gst_flv_demux_video_negotiate (GstFlvDemux * demux, guint32 codec_tag) /* Generate caps for that pad */ switch (codec_tag) { case 2: - caps = gst_caps_new_empty_simple ("video/x-flash-video"); + caps = + gst_caps_new_simple ("video/x-flash-video", "flvversion", G_TYPE_INT, + 1, NULL); break; case 3: caps = gst_caps_new_empty_simple ("video/x-flash-screen"); @@ -1699,6 +1701,17 @@ gst_flv_demux_parse_header (GstFlvDemux * demux, GstBuffer * buffer) } } + if (map.data[3] == '1') { + GST_DEBUG_OBJECT (demux, "FLV version 1 detected"); + } else { + if (G_UNLIKELY (demux->strict)) { + GST_WARNING_OBJECT (demux, "invalid header version detected"); + ret = GST_FLOW_EOS; + goto beach; + } + + } + /* Now look at audio/video flags */ { guint8 flags = map.data[4];