Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-07-08 04:41:55 +0300
committerJames Almer <jamrial@gmail.com>2016-07-20 03:12:18 +0300
commitb3820cabad87c4df7bce82f7aacd2c5c54fd1252 (patch)
tree747139cc61fb31a99848232bd3e14434591d362b /libavformat/oggenc.c
parent5adfbd391847fcdaea1e9b105fae2dd90af2a733 (diff)
avformat/oggenc: fix page duration calculation when granule differs from timestamp
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/oggenc.c')
-rw-r--r--libavformat/oggenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 6940a7b02f..952261b4af 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -193,7 +193,7 @@ static int ogg_buffer_page(AVFormatContext *s, OGGStreamContext *oggstream)
return AVERROR(ENOMEM);
l->page = oggstream->page;
- oggstream->page.start_granule = oggstream->page.granule;
+ oggstream->page.start_granule = ogg_granule_to_timestamp(oggstream, oggstream->page.granule);
oggstream->page_count++;
ogg_reset_cur_page(oggstream);
@@ -265,8 +265,8 @@ static int ogg_buffer_data(AVFormatContext *s, AVStream *st,
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 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);