mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/demux: don't truncate the return value of ts_to_samples()
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
928e7c60cc
commit
0ea87ebc19
|
@ -1346,7 +1346,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
|
||||||
if (sti->first_discard_sample && pkt->pts != AV_NOPTS_VALUE) {
|
if (sti->first_discard_sample && pkt->pts != AV_NOPTS_VALUE) {
|
||||||
int64_t pts = pkt->pts - (is_relative(pkt->pts) ? RELATIVE_TS_BASE : 0);
|
int64_t pts = pkt->pts - (is_relative(pkt->pts) ? RELATIVE_TS_BASE : 0);
|
||||||
int64_t sample = ts_to_samples(st, pts);
|
int64_t sample = ts_to_samples(st, pts);
|
||||||
int duration = ts_to_samples(st, pkt->duration);
|
int64_t duration = ts_to_samples(st, pkt->duration);
|
||||||
int64_t end_sample = sample + duration;
|
int64_t end_sample = sample + duration;
|
||||||
if (duration > 0 && end_sample >= sti->first_discard_sample &&
|
if (duration > 0 && end_sample >= sti->first_discard_sample &&
|
||||||
sample < sti->last_discard_sample)
|
sample < sti->last_discard_sample)
|
||||||
|
|
Loading…
Reference in New Issue