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@chromium.org>
Reviewed-by: Sasi Inguva <isasi-at-google.com@ffmpeg.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Dale Curtis 2017-10-16 14:17:35 -07:00 committed by Michael Niedermayer
parent 279dc40716
commit a5fd8aa45b
3 changed files with 16 additions and 1 deletions

View File

@ -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);

View File

@ -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

View File

@ -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