mkvtoolnix/tests/test-600mpeg_ts_multiple_programs.rb

12 lines
250 B
Ruby
Raw Normal View History

MPEG TS: parse all PMTs in streams with multiple programs properly Earlier versions of mkvmerge used to detect all tracks in MPEG transport streams with multiple programs, even though the code wasn't really implemented & tested for that. However, some tracks (usually those from the second or a later program) were broken: they might not contain any data, or only invalid data. On top of that mkvmerge v12.0.0 contains a fix for #1980 where a track isn't part of a PMT at all. An unintentional consequence of that fix was that mkvmerge no longer detected all of the tracks in multi-program streams. The reason is that in order to detect tracks not mentioned in a PMT mkvmerge has to do detection by content in the PES packets. That's only implemented for AAC at the moment. All other tracks will be blacklisted as soon as they're found. This wouldn't be a problem if all PMTs of all programs were always located right at the start of the file with nothing in between. Unfortunately many files contain track content between PMTs. So that workflow was: • mkvmerge finds first PMT, determines types for tracks listed in it • mkvmerge now considers the PMT to be found • Continuing scanning the file mkvmerge encounters content for tracks not listed in the first PMT, attempting type detection by content, failing for most and blacklisting their PIDs • Next a second PMT is found, however, the PIDs listed in that PMT may have already been found and blacklisted before — therefor they won't be considered anymore With this fix mkvmerge actively looks for the PMTs for all programs. Detection by content is only attempted once all PMTs have been located. That way all tracks will be detected again. A side effect of either this patch or one of the other ones before is that the track content is now OK. I don't know exactly why or which commit actually fixed it. Fixes parts of #1990.
2017-05-22 17:43:03 +00:00
#!/usr/bin/ruby -w
files = (1..2).map { |n| "data/ts/multiple_programs_#{n}.ts" }
# T_600mpeg_ts_multiple_programs
describe "mkvmerge / MPEG transport streams with multiple programs"
files.each do |file|
test_merge file
test_identify file
end