[FFmpeg-cvslog] matroskadec: export CodecDelay

Anton Khirnov git at videolan.org
Mon Nov 14 16:18:41 EET 2016


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Jul  2 09:55:19 2016 +0200| [40f74dc87acb3f5bbb51f273790a4a7a64201b16] | committer: Anton Khirnov

matroskadec: export CodecDelay

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

 libavformat/matroskadec.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index ceac4ba..7ccba57 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1832,6 +1832,13 @@ static int matroska_parse_tracks(AVFormatContext *s)
         avpriv_set_pts_info(st, 64, matroska->time_scale * track->time_scale,
                             1000 * 1000 * 1000);    /* 64 bit pts in ns */
 
+        if (track->type == MATROSKA_TRACK_TYPE_AUDIO &&
+            track->audio.out_samplerate) {
+            st->codecpar->initial_padding = av_rescale_q(track->codec_delay,
+                                                         (AVRational){ 1, 1000000000 },
+                                                         (AVRational){ 1, track->audio.out_samplerate });
+        }
+
         /* convert the delay from ns to the track timebase */
         track->codec_delay = av_rescale_q(track->codec_delay,
                                           (AVRational){ 1, 1000000000 },



More information about the ffmpeg-cvslog mailing list