hlsdemux: Fix seeking
We also have to update the current_file GList pointer in the M3U playlist client, otherwise we are just continuing playback from the current position instead of seeking.
This commit is contained in:
parent
1e1e73a0f2
commit
6c968ed3da
@ -307,7 +307,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||||||
GstSeekType start_type, stop_type;
|
GstSeekType start_type, stop_type;
|
||||||
gint64 start, stop;
|
gint64 start, stop;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
GList *walk;
|
GList *walk, *current_file = NULL;
|
||||||
GstClockTime current_pos, target_pos;
|
GstClockTime current_pos, target_pos;
|
||||||
gint64 current_sequence;
|
gint64 current_sequence;
|
||||||
GstM3U8MediaFile *file;
|
GstM3U8MediaFile *file;
|
||||||
@ -376,6 +376,7 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||||||
file = walk->data;
|
file = walk->data;
|
||||||
|
|
||||||
current_sequence = file->sequence;
|
current_sequence = file->sequence;
|
||||||
|
current_file = walk;
|
||||||
if (current_pos <= target_pos && target_pos < current_pos + file->duration) {
|
if (current_pos <= target_pos && target_pos < current_pos + file->duration) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -390,6 +391,8 @@ gst_hls_demux_seek (GstAdaptiveDemux * demux, GstEvent * seek)
|
|||||||
GST_DEBUG_OBJECT (demux, "seeking to sequence %u", (guint) current_sequence);
|
GST_DEBUG_OBJECT (demux, "seeking to sequence %u", (guint) current_sequence);
|
||||||
hlsdemux->reset_pts = TRUE;
|
hlsdemux->reset_pts = TRUE;
|
||||||
hlsdemux->client->sequence = current_sequence;
|
hlsdemux->client->sequence = current_sequence;
|
||||||
|
hlsdemux->client->current_file =
|
||||||
|
current_file ? current_file : hlsdemux->client->current->files;
|
||||||
hlsdemux->client->sequence_position = current_pos;
|
hlsdemux->client->sequence_position = current_pos;
|
||||||
GST_M3U8_CLIENT_UNLOCK (hlsdemux->client);
|
GST_M3U8_CLIENT_UNLOCK (hlsdemux->client);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user