[FFmpeg-devel] [PATCH] avformat/oggenc: fix page size/duration calculation when granule differs from timestamp

James Almer jamrial at gmail.com
Wed Jul 6 03:48:17 EEST 2016


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/oggenc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index f998af3..34f7e0f 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -263,10 +263,10 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
         {
             AVStream *st = s->streams[page->stream_index];
 
-            int64_t start = av_rescale_q(page->start_granule, st->time_base,
-                                         AV_TIME_BASE_Q);
-            int64_t next  = av_rescale_q(page->granule, st->time_base,
-                                         AV_TIME_BASE_Q);
+            int64_t start = av_rescale_q(ogg_granule_to_timestamp(oggstream, page->start_granule),
+                                         st->time_base, AV_TIME_BASE_Q);
+            int64_t next  = av_rescale_q(ogg_granule_to_timestamp(oggstream, page->granule),
+                                         st->time_base, AV_TIME_BASE_Q);
 
             if (page->segments_count == 255) {
                 ogg_buffer_page(s, oggstream);
-- 
2.9.0



More information about the ffmpeg-devel mailing list