mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 19:59:46 +00:00
ffplay: use frame->pkt_pts instead of pkt->pts in audio pts calculation
Fixes ticket #2717. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
84343dd9d3
commit
447d2e31d1
4
ffplay.c
4
ffplay.c
@ -2177,8 +2177,8 @@ static int audio_decode_frame(VideoState *is)
|
||||
tb = (AVRational){1, is->frame->sample_rate};
|
||||
if (is->frame->pts != AV_NOPTS_VALUE)
|
||||
is->frame->pts = av_rescale_q(is->frame->pts, dec->time_base, tb);
|
||||
if (is->frame->pts == AV_NOPTS_VALUE && pkt_temp->pts != AV_NOPTS_VALUE)
|
||||
is->frame->pts = av_rescale_q(pkt_temp->pts, is->audio_st->time_base, tb);
|
||||
else if (is->frame->pkt_pts != AV_NOPTS_VALUE)
|
||||
is->frame->pts = av_rescale_q(is->frame->pkt_pts, is->audio_st->time_base, tb);
|
||||
if (pkt_temp->pts != AV_NOPTS_VALUE)
|
||||
pkt_temp->pts += (double) is->frame->nb_samples / is->frame->sample_rate / av_q2d(is->audio_st->time_base);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user