mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-03 13:02:29 +00:00
dashdemux: Ensure that we never ever download over the current SIDX entry
Even if downloading more than needed to try to get the moof and first keyframe both together.
This commit is contained in:
parent
71259d9ad4
commit
d884ec2904
1 changed files with 18 additions and 6 deletions
|
@ -2704,9 +2704,15 @@ gst_dash_demux_need_another_chunk (GstAdaptiveDemuxStream * stream)
|
|||
dashstream->sidx_base_offset +
|
||||
SIDX_CURRENT_ENTRY (dashstream)->offset +
|
||||
SIDX_CURRENT_ENTRY (dashstream)->size;
|
||||
guint64 downloaded_end_offset =
|
||||
dashstream->current_offset +
|
||||
gst_adapter_available (dashstream->adapter);
|
||||
guint64 downloaded_end_offset;
|
||||
|
||||
if (dashstream->current_offset == GST_CLOCK_TIME_NONE) {
|
||||
downloaded_end_offset = stream->fragment.range_start;
|
||||
} else {
|
||||
downloaded_end_offset =
|
||||
dashstream->current_offset +
|
||||
gst_adapter_available (dashstream->adapter);
|
||||
}
|
||||
|
||||
if (stream->fragment.chunk_size +
|
||||
downloaded_end_offset > sidx_end_offset) {
|
||||
|
@ -2722,9 +2728,15 @@ gst_dash_demux_need_another_chunk (GstAdaptiveDemuxStream * stream)
|
|||
&g_array_index (dashstream->moof_sync_samples,
|
||||
GstDashStreamSyncSample, 0);
|
||||
guint64 end_offset = sync_sample->end_offset + 1;
|
||||
guint64 downloaded_end_offset =
|
||||
dashstream->current_offset +
|
||||
gst_adapter_available (dashstream->adapter);
|
||||
guint64 downloaded_end_offset;
|
||||
|
||||
if (dashstream->current_offset == GST_CLOCK_TIME_NONE) {
|
||||
downloaded_end_offset = stream->fragment.range_start;
|
||||
} else {
|
||||
downloaded_end_offset =
|
||||
dashstream->current_offset +
|
||||
gst_adapter_available (dashstream->adapter);
|
||||
}
|
||||
|
||||
if (gst_mpd_client_has_isoff_ondemand_profile (dashdemux->client) &&
|
||||
dashstream->sidx_parser.sidx.entries) {
|
||||
|
|
Loading…
Reference in a new issue