From 91a28b0e8e4f09a8256727e8a514bf98da81e186 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 7 Feb 2012 15:37:45 -0500 Subject: avcodec: add ff_samples_to_time_base() convenience function to internal.h --- libavcodec/libvorbis.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavcodec/libvorbis.c') diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c index 25e600671f..4d58fdc34e 100644 --- a/libavcodec/libvorbis.c +++ b/libavcodec/libvorbis.c @@ -29,8 +29,8 @@ #include "libavutil/opt.h" #include "avcodec.h" #include "bytestream.h" +#include "internal.h" #include "vorbis.h" -#include "libavutil/mathematics.h" #undef NDEBUG #include @@ -216,7 +216,8 @@ static int oggvorbis_encode_frame(AVCodecContext *avccontext, op2->packet = context->buffer + sizeof(ogg_packet); l = op2->bytes; - avccontext->coded_frame->pts = av_rescale_q(op2->granulepos, (AVRational) { 1, avccontext->sample_rate }, avccontext->time_base); + avccontext->coded_frame->pts = ff_samples_to_time_base(avccontext, + op2->granulepos); //FIXME we should reorder the user supplied pts and not assume that they are spaced by 1/sample_rate if (l > buf_size) { -- cgit v1.2.3