diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-07-02 09:55:19 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-07-03 09:13:29 +0200 |
commit | 40f74dc87acb3f5bbb51f273790a4a7a64201b16 (patch) | |
tree | 71a3ca877ead257be218dcae2428ce354c5ff2f2 | |
parent | 582d4211e00015b68626f77ce4af53161e2b1713 (diff) | |
download | ffmpeg-streaming-40f74dc87acb3f5bbb51f273790a4a7a64201b16.zip ffmpeg-streaming-40f74dc87acb3f5bbb51f273790a4a7a64201b16.tar.gz |
matroskadec: export CodecDelay
-rw-r--r-- | libavformat/matroskadec.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 }, |