[FFmpeg-cvslog] lavf/oggparseopus: Setting seek_preroll in AVCodecContext

Vignesh Venkatasubramanian git at videolan.org
Wed Feb 5 21:20:40 CET 2014


ffmpeg | branch: master | Vignesh Venkatasubramanian <vigneshv at google.com> | Wed Feb  5 07:36:13 2014 -0800| [129e24f78e5dd2166211156346872ee92545b8a4] | committer: Michael Niedermayer

lavf/oggparseopus: Setting seek_preroll in AVCodecContext

Setting seek_preroll value in AVCodecContext for Opus streams
embedded in ogg container.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv at google.com>
Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=129e24f78e5dd2166211156346872ee92545b8a4
---

 libavformat/oggparseopus.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/oggparseopus.c b/libavformat/oggparseopus.c
index 553ddb0..75c6114 100644
--- a/libavformat/oggparseopus.c
+++ b/libavformat/oggparseopus.c
@@ -32,6 +32,7 @@ struct oggopus_private {
     int64_t cur_dts;
 };
 
+#define OPUS_SEEK_PREROLL_MS 80
 #define OPUS_HEAD_SIZE 19
 
 static int opus_header(AVFormatContext *avf, int idx)
@@ -66,6 +67,9 @@ static int opus_header(AVFormatContext *avf, int idx)
         memcpy(st->codec->extradata, packet, os->psize);
 
         st->codec->sample_rate = 48000;
+        av_codec_set_seek_preroll(st->codec,
+                                  av_rescale(OPUS_SEEK_PREROLL_MS,
+                                             st->codec->sample_rate, 1000));
         avpriv_set_pts_info(st, 64, 1, 48000);
         priv->need_comments = 1;
         return 1;



More information about the ffmpeg-cvslog mailing list