mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 15:51:11 +00:00
hlsdemux: Fix decrypting fragments
Only reset the decryption engine on the first buffer of a fragment, not again for the second buffer. This fixes corrupting the second buffer of a fragment. https://bugzilla.gnome.org/show_bug.cgi?id=731968
This commit is contained in:
parent
ae99043506
commit
b1fac8c781
2 changed files with 5 additions and 1 deletions
|
@ -805,7 +805,7 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||
gsize available;
|
||||
|
||||
/* restart the decrypting lib for a new fragment */
|
||||
if (demux->starting_fragment) {
|
||||
if (demux->reset_crypto) {
|
||||
GstFragment *key_fragment;
|
||||
GstBuffer *key_buffer;
|
||||
GstMapInfo key_info;
|
||||
|
@ -842,6 +842,8 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
|
|||
gst_buffer_unmap (key_buffer, &key_info);
|
||||
gst_buffer_unref (key_buffer);
|
||||
g_object_unref (key_fragment);
|
||||
|
||||
demux->reset_crypto = FALSE;
|
||||
}
|
||||
|
||||
gst_adapter_push (demux->adapter, buffer);
|
||||
|
@ -1989,6 +1991,7 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux,
|
|||
demux->current_timestamp = timestamp;
|
||||
demux->current_duration = duration;
|
||||
demux->starting_fragment = TRUE;
|
||||
demux->reset_crypto = TRUE;
|
||||
demux->current_key = key;
|
||||
demux->current_iv = iv;
|
||||
|
||||
|
|
|
@ -121,6 +121,7 @@ struct _GstHLSDemux
|
|||
GstClockTime current_timestamp;
|
||||
GstClockTime current_duration;
|
||||
gboolean starting_fragment;
|
||||
gboolean reset_crypto;
|
||||
gint64 download_start_time;
|
||||
gint64 download_total_time;
|
||||
gint64 download_total_bytes;
|
||||
|
|
Loading…
Reference in a new issue