Class: Mkv2m4v::AudioRanker

Inherits:
TrackRanker show all
Defined in:
lib/mkv2m4v/track_ranker.rb

Instance Method Summary collapse

Methods inherited from TrackRanker

#filter, #initialize, #rank

Constructor Details

This class inherits a constructor from Mkv2m4v::TrackRanker

Instance Method Details

#score(track) ⇒ Object



48
49
50
51
52
53
54
55
56
57
# File 'lib/mkv2m4v/track_ranker.rb', line 48

def score(track)
  score = 0
  score += 4 if ["DTS", "AC-3"].include?(track.format)
  score += 2 if track.format == "AAC"
  score += (track.channel_count || 0) / 8.0 * 2.0
  score += (track.bit_rate_kbps || 0) / 1500.0 * 2.0
  score += 4 if language_match?(track)
  score *= -1 unless ["DTS", "AC-3", "AAC"].include?(track.format)
  score
end