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:
-rw-r--r--libavformat/matroskadec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index ceac4babef..7ccba57fe5 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 },