lavf/webm_dash: Fix incorrect bandwidth computation
Fix incorrect bandwidth computation in some cases. When the cue end descriptor is null (i.e.) start_time_ns == -1, existing bandwidth computed (if any) should be returned rather than returning 0. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8acb76567a
commit
b1071db3df
@ -3188,9 +3188,10 @@ static int64_t webm_dash_manifest_compute_bandwidth(AVFormatContext *s, int64_t
|
|||||||
}
|
}
|
||||||
if (desc_end.start_time_ns == -1) {
|
if (desc_end.start_time_ns == -1) {
|
||||||
// The prebuffer is larger than the duration.
|
// The prebuffer is larger than the duration.
|
||||||
return (matroska->duration * matroska->time_scale >= prebuffered_ns) ? -1 : 0;
|
if (matroska->duration * matroska->time_scale >= prebuffered_ns)
|
||||||
}
|
return -1;
|
||||||
|
bits_per_second = 0.0;
|
||||||
|
} else {
|
||||||
// The prebuffer ends in the last Cue. Estimate how much data was
|
// The prebuffer ends in the last Cue. Estimate how much data was
|
||||||
// prebuffered.
|
// prebuffered.
|
||||||
pre_bytes = desc_end.end_offset - desc_end.start_offset;
|
pre_bytes = desc_end.end_offset - desc_end.start_offset;
|
||||||
@ -3237,6 +3238,7 @@ static int64_t webm_dash_manifest_compute_bandwidth(AVFormatContext *s, int64_t
|
|||||||
|
|
||||||
desc_end = get_cue_desc(s, desc_end.end_time_ns, cues_start);
|
desc_end = get_cue_desc(s, desc_end.end_time_ns, cues_start);
|
||||||
} while (desc_end.start_time_ns != -1);
|
} while (desc_end.start_time_ns != -1);
|
||||||
|
}
|
||||||
if (bandwidth < bits_per_second) bandwidth = bits_per_second;
|
if (bandwidth < bits_per_second) bandwidth = bits_per_second;
|
||||||
}
|
}
|
||||||
return (int64_t)bandwidth;
|
return (int64_t)bandwidth;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user