[FFmpeg-cvslog] lavf: use initial_padding instead of deprecated delay

Anton Khirnov git at videolan.org
Tue Oct 14 03:41:38 CEST 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Aug 23 13:12:51 2014 +0000| [eabdc2a830f1ab1a3f12243eb7e2fba801cb81f0] | committer: Anton Khirnov

lavf: use initial_padding instead of deprecated delay

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

 libavformat/matroskaenc.c |    7 ++++---
 libavformat/oggenc.c      |    5 ++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 225f6a6..f057c07 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -742,13 +742,14 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
     if (!(st->disposition & AV_DISPOSITION_DEFAULT))
         put_ebml_uint(pb, MATROSKA_ID_TRACKFLAGDEFAULT, !!(st->disposition & AV_DISPOSITION_DEFAULT));
 
-    if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->delay) {
-        mkv->tracks[i].ts_offset = av_rescale_q(codec->delay,
+    if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->initial_padding) {
+        mkv->tracks[i].ts_offset = av_rescale_q(codec->initial_padding,
                                                 (AVRational){ 1, codec->sample_rate },
                                                 st->time_base);
 
         put_ebml_uint(pb, MATROSKA_ID_CODECDELAY,
-                      av_rescale_q(codec->delay, (AVRational){ 1, codec->sample_rate },
+                      av_rescale_q(codec->initial_padding,
+                                   (AVRational){ 1, codec->sample_rate },
                                    (AVRational){ 1, 1000000000 }));
     }
 
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index 489f010..1277a8b 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -564,7 +564,10 @@ static int ogg_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
         }
         granule = (oggstream->last_kf_pts<<oggstream->kfgshift) | pframe_count;
     } else if (st->codec->codec_id == AV_CODEC_ID_OPUS)
-        granule = pkt->pts + pkt->duration + av_rescale_q(st->codec->delay, (AVRational){ 1, st->codec->sample_rate }, st->time_base);
+        granule = pkt->pts + pkt->duration +
+                  av_rescale_q(st->codec->initial_padding,
+                               (AVRational){ 1, st->codec->sample_rate },
+                               st->time_base);
     else
         granule = pkt->pts + pkt->duration;
 



More information about the ffmpeg-cvslog mailing list