1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/wavdec: Dont rescale timestamps but use exact comparission

Fixes integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-06-08 19:22:34 +02:00
parent 9e9ec5ad2a
commit 2a91038e13

View File

@ -462,10 +462,10 @@ smv_retry:
video_dts = s->streams[1]->cur_dts;
if (audio_dts != AV_NOPTS_VALUE && video_dts != AV_NOPTS_VALUE) {
audio_dts = av_rescale_q(audio_dts, s->streams[0]->time_base, AV_TIME_BASE_Q);
video_dts = av_rescale_q(video_dts, s->streams[1]->time_base, AV_TIME_BASE_Q);
/*We always return a video frame first to get the pixel format first*/
wav->smv_last_stream = wav->smv_given_first ? video_dts > audio_dts : 0;
wav->smv_last_stream = wav->smv_given_first ?
av_compare_ts(video_dts, s->streams[1]->time_base,
audio_dts, s->streams[0]->time_base) > 0 : 0;
wav->smv_given_first = 1;
}
wav->smv_last_stream = !wav->smv_last_stream;