lib/m3u8/playlist.rb in m3u8-0.1.0 vs lib/m3u8/playlist.rb in m3u8-0.1.1

- old
+ new

@@ -126,18 +126,21 @@ return 'mp4a.40.34' if audio.downcase == 'mp3' end end def video_codec profile, level - unless profile.nil? and level.nil? - return 'avc1.66.30' if profile.downcase == 'baseline' and level == 3.0 - return 'avc1.42001f' if profile.downcase == 'baseline' and level == 3.1 - return 'avc1.77.30' if profile.downcase == 'main' and level == 3.0 - return 'avc1.4d001f' if profile.downcase == 'main' and level == 3.1 - return 'avc1.4d0028' if profile.downcase == 'main' and level == 4.0 - return 'avc1.64001f' if profile.downcase == 'high' and level == 3.1 - return 'avc1.640028' if profile.downcase == 'high' and (level == 4.0 or level == 4.1) + if profile.nil? or level.nil? + return end + + profile = profile.downcase + return 'avc1.66.30' if profile == 'baseline' and level == 3.0 + return 'avc1.42001f' if profile == 'baseline' and level == 3.1 + return 'avc1.77.30' if profile == 'main' and level == 3.0 + return 'avc1.4d001f' if profile == 'main' and level == 3.1 + return 'avc1.4d0028' if profile == 'main' and level == 4.0 + return 'avc1.64001f' if profile == 'high' and level == 3.1 + return 'avc1.640028' if profile == 'high' and (level == 4.0 or level == 4.1) end def resolution width, height unless width.nil? "RESOLUTION=#{width}x#{height}," \ No newline at end of file