diff options
author | Alex Ashley <bugzilla@ashley-family.net> | 2016-02-09 13:17:00 +0000 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-02-17 17:04:25 +0200 |
commit | 97f6f7c71348dc49b32183f83c1000379ead2b77 (patch) | |
tree | 30511ff3a6748195aa44d5556b3b9f21cb9a8c78 | |
parent | f2f31ec50f08d24fc8859b382a0f895ff330248f (diff) | |
download | gstreamer-plugins-good-97f6f7c71348dc49b32183f83c1000379ead2b77.tar.gz |
qtdemux: only transform protected caps once
Commit 7873bede3134b15e5066e8d14e54d1f5054d2063
(https://bugzilla.gnome.org/show_bug.cgi?id=760774) changed the
behaviour of qtdemux to call gst_qtdemux_configure_stream() for
every new moof.
When playing a protected stream, gst_qtdemux_configure_stream()
calls gst_qtdemux_configure_protected_caps(). The
gst_qtdemux_configure_protected_caps() function takes the original
media format, puts this in a field called "original-media-type"
and then changes the caps to "application/x-cenc".
The gst_qtdemux_configure_protected_caps() did not handle the case
of being called multiple times, causing it to incorrectly set the
caps. The second call was causing the caps to be set to:
application/x-cenc, original-media-type"application/x-cenc"
This commit makes gst_qtdemux_configure_protected_caps() check that
the caps have already been transformed, so that it only gets
changed once.
https://bugzilla.gnome.org/show_bug.cgi?id=761769
-rw-r--r-- | gst/isomp4/qtdemux.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index de5f5d559..a45801105 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -6935,11 +6935,13 @@ gst_qtdemux_configure_protected_caps (GstQTDemux * qtdemux, } s = gst_caps_get_structure (stream->caps, 0); - gst_structure_set (s, - "original-media-type", G_TYPE_STRING, gst_structure_get_name (s), - GST_PROTECTION_SYSTEM_ID_CAPS_FIELD, G_TYPE_STRING, selected_system, - NULL); - gst_structure_set_name (s, "application/x-cenc"); + if (!gst_structure_has_name (s, "application/x-cenc")) { + gst_structure_set (s, + "original-media-type", G_TYPE_STRING, gst_structure_get_name (s), + GST_PROTECTION_SYSTEM_ID_CAPS_FIELD, G_TYPE_STRING, selected_system, + NULL); + gst_structure_set_name (s, "application/x-cenc"); + } return TRUE; } |