Fixes ticket #2717.
Signed-off-by: Marton Balint <cus@passwd.hu>
... | ... |
@@ -2177,8 +2177,8 @@ static int audio_decode_frame(VideoState *is) |
2177 | 2177 |
tb = (AVRational){1, is->frame->sample_rate}; |
2178 | 2178 |
if (is->frame->pts != AV_NOPTS_VALUE) |
2179 | 2179 |
is->frame->pts = av_rescale_q(is->frame->pts, dec->time_base, tb); |
2180 |
- if (is->frame->pts == AV_NOPTS_VALUE && pkt_temp->pts != AV_NOPTS_VALUE) |
|
2181 |
- is->frame->pts = av_rescale_q(pkt_temp->pts, is->audio_st->time_base, tb); |
|
2180 |
+ else if (is->frame->pkt_pts != AV_NOPTS_VALUE) |
|
2181 |
+ is->frame->pts = av_rescale_q(is->frame->pkt_pts, is->audio_st->time_base, tb); |
|
2182 | 2182 |
if (pkt_temp->pts != AV_NOPTS_VALUE) |
2183 | 2183 |
pkt_temp->pts += (double) is->frame->nb_samples / is->frame->sample_rate / av_q2d(is->audio_st->time_base); |
2184 | 2184 |
|