diff options
Diffstat (limited to 'contrib/ffmpeg/A12-mov-initial_padding.patch')
-rw-r--r-- | contrib/ffmpeg/A12-mov-initial_padding.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A12-mov-initial_padding.patch b/contrib/ffmpeg/A12-mov-initial_padding.patch new file mode 100644 index 000000000..61ca81907 --- /dev/null +++ b/contrib/ffmpeg/A12-mov-initial_padding.patch @@ -0,0 +1,42 @@ +From 70deb2f2c99677e91b8a404882d9bb0db1791efa Mon Sep 17 00:00:00 2001 +From: John Stebbins <[email protected]> +Date: Tue, 21 Feb 2017 10:46:02 -0700 +Subject: [PATCH] mov: extract audio initial_padding from edit list + +--- + libavformat/mov.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/libavformat/mov.c b/libavformat/mov.c +index 1657647..a080216 100644 +--- a/libavformat/mov.c ++++ b/libavformat/mov.c +@@ -3806,13 +3806,24 @@ static int mov_read_header(AVFormatContext *s) + MOVStreamContext *sc = st->priv_data; + + switch (st->codecpar->codec_type) { +- case AVMEDIA_TYPE_AUDIO: ++ case AVMEDIA_TYPE_AUDIO: { ++ int64_t skip_samples; + err = ff_replaygain_export(st, s->metadata); + if (err < 0) { + mov_read_close(s); + return err; + } ++ skip_samples = av_rescale(sc->time_offset_skip, ++ st->codecpar->sample_rate, ++ sc->time_scale); ++ /* If the number of skipped samples specified in the edit list ++ * is in a range that looks like an initial_padding, set ++ * initial_padding to tell decoders to drop the samples */ ++ if (skip_samples > 0 && skip_samples <= 3840) { ++ st->codecpar->initial_padding = skip_samples; ++ } + break; ++ } + case AVMEDIA_TYPE_VIDEO: + if (sc->display_matrix) { + err = av_stream_add_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, +-- +2.9.3 + |