mssdemux: fix getting current position in segments when after last one

For live streams this makes a difference when resyncing after a
Manifest refresh, otherwise it doesn't know where to restart
This commit is contained in:
Thiago Santos 2014-12-04 12:21:04 -03:00
parent a2c31e38d1
commit a105af22f2

View file

@ -855,8 +855,14 @@ gst_mss_stream_get_fragment_gst_timestamp (GstMssStream * stream)
g_return_val_if_fail (stream->active, GST_FLOW_ERROR);
if (!stream->current_fragment)
return GST_CLOCK_TIME_NONE;
if (!stream->current_fragment) {
GList *last = g_list_last (stream->fragments);
if (last == NULL)
return GST_CLOCK_TIME_NONE;
fragment = last->data;
return fragment->time + (fragment->duration * fragment->repetitions);
}
fragment = stream->current_fragment->data;