From 519e45375172d6de1cf3d2450939006c7701bfcf Mon Sep 17 00:00:00 2001 From: trizen Date: Sat, 8 Aug 2020 14:49:36 +0300 Subject: When `prefer_mp4` is true and there is no AVC MP4 available, prefer VP9 over AV1. Much faster to decode. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- lib/WWW/FairViewer.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/WWW/FairViewer.pm b/lib/WWW/FairViewer.pm index bb23de7..037f469 100644 --- a/lib/WWW/FairViewer.pm +++ b/lib/WWW/FairViewer.pm @@ -922,10 +922,12 @@ sub get_streaming_urls { } if ($url->{type} =~ /\bvideo\b/i) { - if ($self->get_prefer_mp4 and $url->{type} =~ /\bmp4\b/i) { - push @video_urls, $url; + if ($url->{type} =~ /\bav[0-9]+\b/i) { # AV1 + if ($self->get_prefer_av1) { + push @video_urls, $url; + } } - elsif ($self->get_prefer_av1 and $url->{type} =~ /\bav[0-9]+\b/i) { + elsif ($self->get_prefer_mp4 and $url->{type} =~ /\bmp4\b/i) { push @video_urls, $url; } } -- cgit v1.2.3