diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2014-01-03 16:20:11 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2014-01-03 16:20:11 +0000 |
commit | 12509f4a80a4469430bcc6e6f5847955ae60440f (patch) | |
tree | 485f84b2a2232e0768b0f21e3d970a6c11bd8301 /gst | |
parent | 7e3811cc21d82604ac6bff6fde6b60307fc9c958 (diff) |
asfdemux: only add "format" field with fourcc to WMV caps
Doesn't make sense for e.g. H264 or MJPEG.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/asfdemux/gstasfdemux.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 72f4274b..d9e86b06 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); |