qtdemux: support seeking of CENC encrypted streams

When playing a stream that has been protected by DASH CENC, playback
will fail if a seek is performed. Qtdemux produces the error "stream
is protected using cenc, but no cenc protection system information
has been found" and playback stops.

The problem is that gst_qtdemux_reset() gets called as part of the
FLUSH during a seek. This function frees the protection_system_ids
array. When gst_qtdemux_configure_protected_caps() is called after the
seek has completed, the protection_system_ids array is empty and
qtdemux is unable to create the correct output caps for the protected
stream.

This commit changes it to only free the protection_system_ids on
hard resets.

https://bugzilla.gnome.org/show_bug.cgi?id=761787
This commit is contained in:
Alex Ashley 2016-02-09 17:17:09 +00:00 committed by Thiago Santos
parent 76506190e9
commit 0c4cc14533

View file

@ -1973,10 +1973,6 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
qtdemux->have_group_id = FALSE; qtdemux->have_group_id = FALSE;
qtdemux->group_id = G_MAXUINT; qtdemux->group_id = G_MAXUINT;
if (qtdemux->protection_system_ids) {
g_ptr_array_free (qtdemux->protection_system_ids, TRUE);
qtdemux->protection_system_ids = NULL;
}
g_queue_foreach (&qtdemux->protection_event_queue, (GFunc) gst_event_unref, g_queue_foreach (&qtdemux->protection_event_queue, (GFunc) gst_event_unref,
NULL); NULL);
g_queue_clear (&qtdemux->protection_event_queue); g_queue_clear (&qtdemux->protection_event_queue);
@ -2001,6 +1997,10 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
qtdemux->timescale = 0; qtdemux->timescale = 0;
qtdemux->got_moov = FALSE; qtdemux->got_moov = FALSE;
qtdemux->pending_configure = FALSE; qtdemux->pending_configure = FALSE;
if (qtdemux->protection_system_ids) {
g_ptr_array_free (qtdemux->protection_system_ids, TRUE);
qtdemux->protection_system_ids = NULL;
}
} else if (qtdemux->mss_mode) { } else if (qtdemux->mss_mode) {
gst_flow_combiner_reset (qtdemux->flowcombiner); gst_flow_combiner_reset (qtdemux->flowcombiner);
for (n = 0; n < qtdemux->n_streams; n++) for (n = 0; n < qtdemux->n_streams; n++)