Skip to content

Commit

Permalink
dcp_inspect: Fix sound channel format consistency check
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangw committed Dec 11, 2023
1 parent 871da48 commit 67d0d38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dcp_inspect
Original file line number Diff line number Diff line change
Expand Up @@ -3917,15 +3917,17 @@ def cpl_inspect_xml( xml, dict, audio_stats, package_dir, composition_summaries,
composition_summary[ :picture_bitrate_avg ] = "Avg [NaN Mb/s]"
end

# Check consistency of ChannelFormat
# Check consistency of channel formats in sound essence
if composition_sound_channel_formats.uniq.size == 1 and composition_sound_channel_formats.first != nil
# we're good
elsif composition_sound_channel_formats.uniq.size == 1 and composition_sound_channel_formats.first == nil
errors << "CPL #{ cpl_id }: Failed to read sound ChannelFormat values from sound essence. Should not happen"
cpl_errors = true
else
errors << "CPL #{ cpl_id }: Found inconsistent sound ChannelFormat values across the composition (#{ composition_sound_channel_formats.each_with_index.map { |v, index| 'Reel ' + ( index + 1 ).to_s + ': ' + v.to_s }.join( ', ' ) }). Playback will fail completely"
cpl_errors = true
unless composition_sound_channel_formats.size == 0 # Supplemental/VF/External
errors << "CPL #{ cpl_id }: Found inconsistent sound ChannelFormat values across the composition (#{ composition_sound_channel_formats.each_with_index.map { |v, index| 'Reel ' + ( index + 1 ).to_s + ': ' + v.to_s }.join( ', ' ) }). Playback will fail completely"
cpl_errors = true
end
end

# Set up composition_sound_channel_count
Expand Down

0 comments on commit 67d0d38

Please sign in to comment.