return 0;
}
+static void
+gst_hls_demux_clear_pending_data (GstHLSDemux * hlsdemux)
+{
+ gst_hls_demux_decrypt_end (hlsdemux);
+ gst_adapter_clear (hlsdemux->pending_encrypted_data);
+ gst_buffer_replace (&hlsdemux->pending_decrypted_buffer, NULL);
+ gst_buffer_replace (&hlsdemux->pending_typefind_buffer, NULL);
+}
+
static gboolean
gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
{
/* properly cleanup pending decryption status */
if (flags & GST_SEEK_FLAG_FLUSH) {
- gst_hls_demux_decrypt_end (hlsdemux);
+ gst_hls_demux_clear_pending_data (hlsdemux);
}
/* Use I-frame variants for trick modes */
GstHLSDemux *hlsdemux = GST_HLS_DEMUX_CAST (demux);
/* only 1 output supported */
+ gst_hls_demux_clear_pending_data (hlsdemux);
gst_adaptive_demux_stream_new (demux, gst_hls_demux_create_pad (hlsdemux));
hlsdemux->reset_pts = TRUE;
g_object_unref (key_fragment);
}
+ gst_hls_demux_clear_pending_data (hlsdemux);
+
return TRUE;
key_failed:
hlsdemux->pending_decrypted_buffer, TRUE);
hlsdemux->pending_decrypted_buffer = NULL;
}
- } else {
- gst_buffer_replace (&hlsdemux->pending_decrypted_buffer, NULL);
- gst_adapter_clear (hlsdemux->pending_encrypted_data);
}
+ gst_hls_demux_clear_pending_data (hlsdemux);
if (ret == GST_FLOW_OK || ret == GST_FLOW_NOT_LINKED)
return gst_adaptive_demux_stream_advance_fragment (demux, stream,
demux->client = gst_m3u8_client_new ("", NULL);
demux->srcpad_counter = 0;
- gst_adapter_clear (demux->pending_encrypted_data);
- gst_buffer_replace (&demux->pending_decrypted_buffer, NULL);
+ gst_hls_demux_clear_pending_data (demux);
gst_buffer_replace (&demux->pending_typefind_buffer, NULL);
if (demux->current_key) {
g_free (demux->current_key);