mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
dashdemux2: Set timestamp relative to period start
These values will be referred to as timestamp relative to period start so need to subtract period start time from the values. Fixes a problem with determining the start position when playing Live content with SegmentTimeline, presentationTimeOffset and a non-0 period start time. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3025>
This commit is contained in:
parent
498ad133ba
commit
699f2ebb45
1 changed files with 8 additions and 5 deletions
|
@ -1862,7 +1862,7 @@ gst_mpd_client2_get_last_fragment_timestamp_end (GstMPDClient2 * client,
|
||||||
|
|
||||||
if (!stream->segments) {
|
if (!stream->segments) {
|
||||||
stream_period = gst_mpd_client2_get_stream_period (client);
|
stream_period = gst_mpd_client2_get_stream_period (client);
|
||||||
*ts = stream_period->start + stream_period->duration;
|
*ts = stream_period->duration;
|
||||||
} else {
|
} else {
|
||||||
segment_idx = gst_mpd_client2_get_segments_counts (client, stream) - 1;
|
segment_idx = gst_mpd_client2_get_segments_counts (client, stream) - 1;
|
||||||
if (segment_idx >= stream->segments->len) {
|
if (segment_idx >= stream->segments->len) {
|
||||||
|
@ -1875,14 +1875,15 @@ gst_mpd_client2_get_last_fragment_timestamp_end (GstMPDClient2 * client,
|
||||||
if (currentChunk->repeat >= 0) {
|
if (currentChunk->repeat >= 0) {
|
||||||
*ts =
|
*ts =
|
||||||
currentChunk->start + (currentChunk->duration * (1 +
|
currentChunk->start + (currentChunk->duration * (1 +
|
||||||
currentChunk->repeat));
|
currentChunk->repeat)) -
|
||||||
|
gst_mpd_client2_get_period_start_time (client);
|
||||||
} else {
|
} else {
|
||||||
/* 5.3.9.6.1: negative repeat means repeat till the end of the
|
/* 5.3.9.6.1: negative repeat means repeat till the end of the
|
||||||
* period, or the next update of the MPD (which I think is
|
* period, or the next update of the MPD (which I think is
|
||||||
* implicit, as this will all get deleted/recreated), or the
|
* implicit, as this will all get deleted/recreated), or the
|
||||||
* start of the next segment, if any. */
|
* start of the next segment, if any. */
|
||||||
stream_period = gst_mpd_client2_get_stream_period (client);
|
stream_period = gst_mpd_client2_get_stream_period (client);
|
||||||
*ts = stream_period->start + stream_period->duration;
|
*ts = stream_period->duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1909,7 +1910,8 @@ gst_mpd_client2_get_next_fragment_timestamp (GstMPDClient2 * client,
|
||||||
|
|
||||||
*ts =
|
*ts =
|
||||||
currentChunk->start +
|
currentChunk->start +
|
||||||
(currentChunk->duration * stream->segment_repeat_index);
|
(currentChunk->duration * stream->segment_repeat_index) -
|
||||||
|
gst_mpd_client2_get_period_start_time (client);
|
||||||
} else {
|
} else {
|
||||||
GstClockTime duration =
|
GstClockTime duration =
|
||||||
gst_mpd_client2_get_segment_duration (client, stream, NULL);
|
gst_mpd_client2_get_segment_duration (client, stream, NULL);
|
||||||
|
@ -2067,7 +2069,8 @@ gst_mpd_client2_get_next_fragment (GstMPDClient2 * client,
|
||||||
|
|
||||||
fragment->timestamp =
|
fragment->timestamp =
|
||||||
currentChunk->start +
|
currentChunk->start +
|
||||||
stream->segment_repeat_index * currentChunk->duration;
|
stream->segment_repeat_index * currentChunk->duration -
|
||||||
|
gst_mpd_client2_get_period_start_time (client);
|
||||||
fragment->duration = currentChunk->duration;
|
fragment->duration = currentChunk->duration;
|
||||||
if (currentChunk->SegmentURL) {
|
if (currentChunk->SegmentURL) {
|
||||||
if (currentChunk->SegmentURL->mediaRange) {
|
if (currentChunk->SegmentURL->mediaRange) {
|
||||||
|
|
Loading…
Reference in a new issue