After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761787 - qtdemux: seek fails with CENC encrypted streams
qtdemux: seek fails with CENC encrypted streams
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: 1.8.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-09 17:17 UTC by A Ashley
Modified: 2016-04-21 20:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
qtdemux: support seeking of CENC encrypted streams (2.45 KB, patch)
2016-02-09 17:27 UTC, A Ashley
none Details | Review
qtdemux: support seeking of CENC encrypted streams (2.16 KB, patch)
2016-02-25 14:43 UTC, A Ashley
none Details | Review

Description A Ashley 2016-02-09 17:17:17 UTC
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.
Comment 1 A Ashley 2016-02-09 17:27:25 UTC
Created attachment 320729 [details] [review]
qtdemux: support seeking of CENC encrypted streams
Comment 2 Thiago Sousa Santos 2016-02-11 15:19:27 UTC
If the flush doesn't remove the event from the sink pad it seems to me that the reset shouldn't clean the protection ids array. Is DASH supposed to re-send the protection event? Or only if it changes?

What do you think?
Comment 3 A Ashley 2016-02-12 11:50:26 UTC
Given that it is a sticky event, I don't think dashdemux should re-send the event unless it changes.

Changing gst_qtdemux_reset() to exclude freeing the protection_system_ids array is easy enough to do. I was worried that there might be a case where the flush was part of re-plugging the element. Re-checking the pad seemed slightly safer, if a bit more work.
Comment 4 Thiago Sousa Santos 2016-02-12 22:54:19 UTC
If it is relinked and there is a new protection-id event it should be sent to qtdemux.

I think updating reset to exclude freeing the protection_system_ids unless it is a 'hard reset' (when going to READY state, for example) makes more sense. If you free it just to read from the pad again it will have the same effect as if you had never freed it, right? If the information changes on the pad you have gotten a new event and the event handling would also update the protection-ids.
Comment 5 A Ashley 2016-02-25 14:43:36 UTC
Created attachment 322378 [details] [review]
qtdemux: support seeking of CENC encrypted streams

Only free protection_system_ids in gst_qtdemux_reset() when performing a hard reset.
Comment 6 Thiago Sousa Santos 2016-04-20 17:10:51 UTC
Thanks for updating the patch. Made a small change to unref the array on a block a few lines below that was already dedicated to a if(hard){} to keep code easier to maintain.

commit 0c4cc1453357fa456f94119ce218fc900f77db56
Author: Alex Ashley <bugzilla@ashley-family.net>
Date:   Tue Feb 9 17:17:09 2016 +0000

    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
Comment 7 Thiago Sousa Santos 2016-04-20 17:12:02 UTC
Please verify that it still works for you. Once confirmed this can be merged to 1.8.x series.
Comment 8 A Ashley 2016-04-21 14:19:21 UTC
(In reply to Thiago Sousa Santos from comment #7)
> Please verify that it still works for you. Once confirmed this can be merged
> to 1.8.x series.

Just checked from master and seeking of a CENC stream works for me.
Comment 9 Thiago Sousa Santos 2016-04-21 20:22:29 UTC
Merged to 1.6 and 1.8 branches

1.6: 5ba07e86e312e63f0fd592d9538dc74d56f82bfd
1.8: 95e82607ef3f80e5d155729cea5e6c05d342c62e