ff_samples_to_time_base: support AV_NOPTS_VALUE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
309a931a38
commit
6952301f33
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user