[FFmpeg-cvslog] avformat/mov: Set start_pad correctly in mov_fix_index()
Dale Curtis
git at videolan.org
Sat Oct 21 04:49:54 EEST 2017
ffmpeg | branch: master | Dale Curtis <dalecurtis at chromium.org> | Mon Oct 16 14:17:35 2017 -0700| [a5fd8aa45b11c10613e6e576033a6b5a16b9cbb9] | committer: Michael Niedermayer
avformat/mov: Set start_pad correctly in mov_fix_index()
Sets the correct start padding value when an edit list is present.
A new fate test is added, fate-mov-440hz-10ms, to ensure this is
handled correctly.
Signed-off-by: Dale Curtis <dalecurtis at chromium.org>
Reviewed-by: Sasi Inguva <isasi-at-google.com at ffmpeg.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5fd8aa45b11c10613e6e576033a6b5a16b9cbb9
---
libavformat/mov.c | 2 +-
tests/fate/mov.mak | 4 ++++
tests/ref/fate/mov-440hz-10ms | 11 +++++++++++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b22a116140..573f134d2d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3249,7 +3249,6 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
// Increment skip_samples for the first non-zero audio edit list
if (first_non_zero_audio_edit > 0 && st->codecpar->codec_id != AV_CODEC_ID_VORBIS) {
st->skip_samples += frame_duration;
- msc->start_pad = st->skip_samples;
}
}
}
@@ -3323,6 +3322,7 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
// Update av stream length
st->duration = edit_list_dts_entry_end - start_dts;
+ msc->start_pad = st->skip_samples;
// Free the old index and the old CTTS structures
av_free(e_old);
diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak
index cfdada7a2e..5013e7d528 100644
--- a/tests/fate/mov.mak
+++ b/tests/fate/mov.mak
@@ -7,6 +7,7 @@ FATE_MOV = fate-mov-3elist \
fate-mov-2elist-elist1-ends-bframe \
fate-mov-3elist-encrypted \
fate-mov-gpmf-remux \
+ fate-mov-440hz-10ms \
FATE_MOV_FFPROBE = fate-mov-aac-2048-priming \
fate-mov-zombie \
@@ -39,6 +40,9 @@ fate-mov-1elist-ends-last-bframe: CMD = framemd5 -i $(TARGET_SAMPLES)/mov/mov-1e
# Makes sure that we handle timestamps of packets in case of multiple edit lists with one of them ending on a B-frame correctly.
fate-mov-2elist-elist1-ends-bframe: CMD = framemd5 -i $(TARGET_SAMPLES)/mov/mov-2elist-elist1-ends-bframe.mov
+# Makes sure that we handle edit lists and start padding correctly.
+fate-mov-440hz-10ms: CMD = framemd5 -i $(TARGET_SAMPLES)/mov/440hz-10ms.m4a
+
fate-mov-aac-2048-priming: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_packets -print_format compact $(TARGET_SAMPLES)/mov/aac-2048-priming.mov
fate-mov-zombie: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_streams -show_packets -show_frames -bitexact -print_format compact $(TARGET_SAMPLES)/mov/white_zombie_scrunch-part.mov
diff --git a/tests/ref/fate/mov-440hz-10ms b/tests/ref/fate/mov-440hz-10ms
new file mode 100644
index 0000000000..498879e52d
--- /dev/null
+++ b/tests/ref/fate/mov-440hz-10ms
@@ -0,0 +1,11 @@
+#format: frame checksums
+#version: 2
+#hash: MD5
+#tb 0: 1/44100
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 44100
+#channel_layout 0: 4
+#channel_layout_name 0: mono
+#stream#, dts, pts, duration, size, hash
+0, 0, 0, 960, 1920, 44e7e48ff08835ce30e93c7971dae7df
More information about the ffmpeg-cvslog
mailing list