Calculate sample table from constant sample size if present

Fixes #764.
This commit is contained in:
Moritz Bunkus 2012-06-05 23:09:10 +02:00
parent e53bbd6837
commit 637bf39882
4 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,10 @@
2012-06-05 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: Fixed handling of tracks in QuickTime/MP4
files with a constant sample size. This fixes the other reason for
the "constant sample size and variable duration not supported"
error. Fixes issue 764.
* mkvmerge: bug fix: Tracks in QuickTime/MP4 files with empty
chunk offset tables (STCO and CO64 atoms) are ignored. This fixes
one of the reasons for the "constant sample size and variable

View File

@ -2005,8 +2005,9 @@ qtmp4_demuxer_c::update_tables(int64_t global_m_time_scale) {
s += chunk_table[j].size;
}
// workaround for fixed-size video frames (dv and uncompressed)
if (sample_table.empty() && ('a' != type)) {
// workaround for fixed-size video frames (dv and uncompressed), but
// also for audio with constant sample size
if (sample_table.empty() && sample_size) {
for (i = 0; i < s; ++i) {
qt_sample_t sample;
@ -2018,7 +2019,7 @@ qtmp4_demuxer_c::update_tables(int64_t global_m_time_scale) {
}
if (sample_table.empty()) {
// constant sampesize
// constant samplesize
if ((1 == durmap_table.size()) || ((2 == durmap_table.size()) && (1 == durmap_table[1].number)))
duration = durmap_table[0].duration;
else

View File

@ -82,7 +82,7 @@ T_232h264_changing_sps_pps:82638c1c1655af0a3df3af3cac333712:passed:20070815-2119
T_233srt_with_coordinates:4275c20e70d4249f3c82e9413b3efc51:passed:20070819-203105:0.397343706
T_234avi_aac_codecid_0x706d:2616d0fa167e0245ccd55b12ed8abd0f:passed:20080223-174500:3.42145391
T_235wav_fmt_chunk_length:58e88ff49d74655d05926eb88e43fcb8:passed:20080226-134540:0.424195517
T_236ac3_in_mov:93a79cc58b08e2fbeae0814d8de2fecd:passed:20080229-103912:0.075465398
T_236ac3_in_mov:69fa2cec882297c8df6bf0d6f25d7195:passed:20080229-103912:0.075465398
T_237ac3_in_wav_iec61937_mode:c041c6953a96568d1e2b8da91622ae6c:passed:20080229-152103:0.296750854
T_238ac3_in_wav_acm_mode:cca52e26a2a6f99788ff2dc21f7f55de:passed:20080229-152339:0.056312684
T_239aac_with_id3_tags:824c4982dcfc3f17c4596002efb8b74b:passed:20080309-170151:0.121431245
@ -210,3 +210,4 @@ T_361file_concatenation:4051dcbcddbde799e7f93b4bb3617897-2db61b8b9a6f7bee36ad9d7
T_362xtr_avc:7e80cf1649489adf8f65a7dc8cef7387-ce680f3ae594f3842b638dcb2949e220:passed:20120416-153515:1.533142
T_363srt_colon_decimal_separator:b911ac82752b41c46e0a8e550f6df0a8:passed:20120520-180625:0.056713461
T_364qtmp4_track_with_empty_chunkmap_table:525b2e6e666a21e66e31c2e8106e1817:passed:20120605-223925:0.081185075
T_365qtmp4_constant_sample_size:adad6bd2e89cf83b4e3857427072b7df-10aaca3e180b5e2a2757c52a30d59d33:passed:20120605-230823:0.321147694

View File

@ -0,0 +1,5 @@
#!/usr/bin/ruby -w
# T_365qtmp4_constant_sample_size
describe "mkvmerge / QuickTime/MP4 files with constant sample size and empty sample tables"
1.upto(2) { |idx| test_merge "data/mp4/fixed_sample_size#{idx}.mp4", :exit_code => :warning }