diff options
Diffstat (limited to 'audio')
-rw-r--r-- | audio/decode/ad_lavc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index f48993f81f..0316f6b7d1 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -186,6 +186,12 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt, struct priv *priv = da->priv; AVCodecContext *avctx = priv->avctx; + // If the decoder discards the timestamp for some reason, we use the + // interpolated PTS. Initialize it so that it works for the initial + // packet as well. + if (mpkt && priv->next_pts == MP_NOPTS_VALUE) + priv->next_pts = mpkt->pts; + int in_len = mpkt ? mpkt->len : 0; AVPacket pkt; |