summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-11 20:23:27 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-11 20:30:55 +0200
commit6952301f33add347906af4d3e10b36a57d933ce0 (patch)
treec4c79b15b7eec604b78393b932206bf1b71e80f5 /libavcodec
parent309a931a38b42c0a635f096cdbea9c21c5e54eab (diff)
ff_samples_to_time_base: support AV_NOPTS_VALUE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/internal.h2
1 files changed, 2 insertions, 0 deletions
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);
}