mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
dash: detect EOS when segments are generated by template
Use the Period duration do know when to end the stream
This commit is contained in:
parent
5b1eda95eb
commit
d353d229b1
1 changed files with 7 additions and 1 deletions
|
@ -2923,6 +2923,8 @@ gst_mpdparser_get_chunk_by_index (GstMpdClient * client, guint indexStream,
|
||||||
segment->duration = list_segment->duration;
|
segment->duration = list_segment->duration;
|
||||||
} else {
|
} else {
|
||||||
GstClockTime duration;
|
GstClockTime duration;
|
||||||
|
GstStreamPeriod *stream_period;
|
||||||
|
|
||||||
g_return_val_if_fail (stream->cur_seg_template->
|
g_return_val_if_fail (stream->cur_seg_template->
|
||||||
MultSegBaseType->SegmentTimeline == NULL, FALSE);
|
MultSegBaseType->SegmentTimeline == NULL, FALSE);
|
||||||
/* segment template generator */
|
/* segment template generator */
|
||||||
|
@ -2930,13 +2932,17 @@ gst_mpdparser_get_chunk_by_index (GstMpdClient * client, guint indexStream,
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (duration))
|
if (!GST_CLOCK_TIME_IS_VALID (duration))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* TODO check PeriodEnd for segment beyond end of period */
|
stream_period = gst_mpdparser_get_stream_period (client);
|
||||||
|
|
||||||
segment->number = indexChunk
|
segment->number = indexChunk
|
||||||
+ stream->cur_seg_template->MultSegBaseType->startNumber;
|
+ stream->cur_seg_template->MultSegBaseType->startNumber;
|
||||||
segment->start_time = duration * indexChunk;
|
segment->start_time = duration * indexChunk;
|
||||||
segment->duration = duration;
|
segment->duration = duration;
|
||||||
segment->SegmentURL = NULL;
|
segment->SegmentURL = NULL;
|
||||||
|
|
||||||
|
if (segment->start_time > stream_period->start + stream_period->duration) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue