asfdemux: only add "format" field with fourcc to WMV caps

Doesn't make sense for e.g. H264 or MJPEG.
This commit is contained in:
Tim-Philipp Müller 2014-01-03 16:20:11 +00:00
parent 7e3811cc21
commit 12509f4a80

View file

@ -2487,6 +2487,7 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux,
guint8 ** p_data, guint64 * p_size) guint8 ** p_data, guint64 * p_size)
{ {
GstTagList *tags = NULL; GstTagList *tags = NULL;
GstStructure *caps_s;
GstBuffer *extradata = NULL; GstBuffer *extradata = NULL;
GstPad *src_pad; GstPad *src_pad;
GstCaps *caps; GstCaps *caps;
@ -2544,10 +2545,14 @@ gst_asf_demux_add_video_stream (GstASFDemux * demux,
gst_structure_remove_field (s, "framerate"); gst_structure_remove_field (s, "framerate");
} }
/* add fourcc format to caps, some proprietary decoders seem to need it */ caps_s = gst_caps_get_structure (caps, 0);
str = g_strdup_printf ("%" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (video->tag));
gst_caps_set_simple (caps, "format", G_TYPE_STRING, str, NULL); /* add format field with fourcc to WMV/VC1 caps to differentiate variants */
g_free (str); 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) { if (codec_name) {
tags = gst_tag_list_new (GST_TAG_VIDEO_CODEC, codec_name, NULL); tags = gst_tag_list_new (GST_TAG_VIDEO_CODEC, codec_name, NULL);