Commit 6952301f authored by Michael Niedermayer's avatar Michael Niedermayer

ff_samples_to_time_base: support AV_NOPTS_VALUE

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 309a931a
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment