From 12509f4a80a4469430bcc6e6f5847955ae60440f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 3 Jan 2014 16:20:11 +0000 Subject: [PATCH] asfdemux: only add "format" field with fourcc to WMV caps Doesn't make sense for e.g. H264 or MJPEG. --- gst/asfdemux/gstasfdemux.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 72f4274b0b..d9e86b062f 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -2487,6 +2487,7 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux, guint8 ** p_data, guint64 * p_size) { GstTagList *tags = NULL; + GstStructure *caps_s; GstBuffer *extradata = NULL; GstPad *src_pad; GstCaps *caps; @@ -2544,10 +2545,14 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux, gst_structure_remove_field (s, "framerate"); } - /* add fourcc format to caps, some proprietary decoders seem to need it */ - str = g_strdup_printf ("%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (video->tag)); - gst_caps_set_simple (caps, "format", G_TYPE_STRING, str, NULL); - g_free (str); + caps_s = gst_caps_get_structure (caps, 0); + + /* add format field with fourcc to WMV/VC1 caps to differentiate variants */ + if (gst_structure_has_name (caps_s, "video/x-wmv")) { + str = g_strdup_printf ("%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (video->tag)); + gst_caps_set_simple (caps, "format", G_TYPE_STRING, str, NULL); + g_free (str); + } if (codec_name) { tags = gst_tag_list_new (GST_TAG_VIDEO_CODEC, codec_name, NULL); -- 2.34.1