MP4 reader: improve test for identical edit list entries

In #2306 a file was provided with an edit list consisting of two
identical entries that span the whole duration of the file as given by
the file headers. The difference to earlier provided files is that the
edits don't start at 0 but slightly later. Therefore a check for
"starting at 0" seems counterproductive.

Fixes #2306.
This commit is contained in:
Moritz Bunkus 2018-05-17 11:45:10 +02:00
parent f26523ebbf
commit aa99dd50f5
2 changed files with 6 additions and 4 deletions

View File

@ -6,6 +6,9 @@
extraction as other tools such as MP4Box cannot handle them
correctly. Implements #2293.
* mkvmerge, mkvextract: AVC/h.264: empty NALUs will now be removed.
* mkvmerge: MP4 reader: improved the detection of edit lists consisting of two
identical entries, each spanning the file's duration as given in the movie
header atom. The second entry is ignored in such cases. See #2306.
## Bug fixes

View File

@ -2451,10 +2451,9 @@ qtmp4_demuxer_c::apply_edit_list() {
edit.segment_duration = 0;
mxdebug_if(m_debug_editlists, boost::format(" %1%: single edit with positive media_time; track start offset %2%; change to non-edit to copy the rest\n") % info % format_timestamp(timeline_cts));
} else if ( (num_edits == 2)
&& (entry_index == 2)
&& (edit == editlist_table.front())
&& (edit.media_time == 0)
} else if ( (num_edits == 2)
&& (entry_index == 2)
&& (edit == editlist_table.front())
&& m_reader.m_duration
&& ((timeline_cts - static_cast<int64_t>(*m_reader.m_duration)) >= timestamp_c::s(-60).to_ns())) {
mxdebug_if(m_debug_editlists,