mkvtoolnix/tests/test-520truehd_mlp_atmos_detection.rb
Moritz Bunkus c9eb86f88d mkvmerge: fix "playlist_file" type in JSON output
"playlist_file" must be an array of strings, not a single string. In
verbose identification output mode this property has always been output
multiple times. In JSON only one of those was actually output, the last
one. Additionally the JSON schema didn't contain "playlist_file" at all.
2016-01-31 13:30:25 +01:00

38 lines
1.1 KiB
Ruby
Executable File

#!/usr/bin/ruby -w
# T_520truehd_mlp_atmos_detection
describe "mkvmerge / identification of TrueHD Atmos"
def verify520 file, track, codec
file = "data/truehd/#{file}"
test "testing #{file}" do
output, _ = identify file, :format => :json
output = output.join ''
json = JSON.parse(output)
valid, errors = json_schema_identification.validate(JSON.load(output))
ok = false
if !valid
puts " JSON validation errors in #{file}:"
puts errors.join("\n")
elsif json["tracks"][track]["codec"] == codec
ok = true
end
json.delete("identification_format_version")
JSON.dump(json).md5 + "+#{ok}"
end
end
verify520 "god-save-the-queen.mlp", 0, "MLP"
verify520 "blueplanet.thd", 0, "TrueHD"
verify520 "blueplanet.thd+ac3", 0, "TrueHD"
verify520 "Dolby_Amaze_Lossless-ATMOS-thedigitaltheater.thd", 0, "TrueHD Atmos"
verify520 "dolby_atmos_truehd_sample.m2ts", 1, "TrueHD Atmos"
verify520 "truehd-atmos+ac3.m2ts", 0, "TrueHD Atmos"