Commit 97f6f7c7 authored by Alex Ashley's avatar Alex Ashley Committed by Sebastian Dröge
Browse files

qtdemux: only transform protected caps once

Commit 7873bede
( 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.
parent f2f31ec5
...@@ -6935,11 +6935,13 @@ gst_qtdemux_configure_protected_caps (GstQTDemux * qtdemux, ...@@ -6935,11 +6935,13 @@ gst_qtdemux_configure_protected_caps (GstQTDemux * qtdemux,
} }
s = gst_caps_get_structure (stream->caps, 0); s = gst_caps_get_structure (stream->caps, 0);
gst_structure_set (s, if (!gst_structure_has_name (s, "application/x-cenc")) {
"original-media-type", G_TYPE_STRING, gst_structure_get_name (s), gst_structure_set (s,
GST_PROTECTION_SYSTEM_ID_CAPS_FIELD, G_TYPE_STRING, selected_system, "original-media-type", G_TYPE_STRING, gst_structure_get_name (s),
gst_structure_set_name (s, "application/x-cenc"); NULL);
gst_structure_set_name (s, "application/x-cenc");
return TRUE; return TRUE;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment