ffmpeg | branch: master | James Almer <jamr...@gmail.com> | Mon Jan 31 22:56:48 
2022 -0300| [0ea87ebc19c843747d6e3f7e060e2f2da634eb03] | committer: James Almer

avformat/demux: don't truncate the return value of ts_to_samples()

Signed-off-by: James Almer <jamr...@gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ea87ebc19c843747d6e3f7e060e2f2da634eb03
---

 libavformat/demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/demux.c b/libavformat/demux.c
index 4509015847..ec34b65288 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -1346,7 +1346,7 @@ static int read_frame_internal(AVFormatContext *s, 
AVPacket *pkt)
         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 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;
             if (duration > 0 && end_sample >= sti->first_discard_sample &&
                 sample < sti->last_discard_sample)

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to