diff --git a/libavcodec/internal.h b/libavcodec/internal.h index dfef6eb31f..2686468545 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -153,6 +153,8 @@ int ff_alloc_packet(AVPacket *avpkt, int size); static av_always_inline int64_t ff_samples_to_time_base(AVCodecContext *avctx, int64_t samples) { + if(samples == AV_NOPTS_VALUE) + return AV_NOPTS_VALUE; return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate }, avctx->time_base); }