From ad3ec34690594266a429b1fbb441e84f39edcdcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Thu, 16 Nov 2017 16:08:23 +0100 Subject: [PATCH] avplay: limit requested video-mode In case the video geometry (WxH) is larger than the current size of the framebuffer, match its size and let libav do the scaling. This enables the playback of 1080p movies on smaller screens. Issue #2583. --- repos/libports/ports/libav.hash | 2 +- repos/libports/src/app/avplay/avplay.patch | 24 +++++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/repos/libports/ports/libav.hash b/repos/libports/ports/libav.hash index c75075c5f..ec25bcf79 100644 --- a/repos/libports/ports/libav.hash +++ b/repos/libports/ports/libav.hash @@ -1 +1 @@ -f0631cd5c85fe9c08ea236de0d062384798a0955 +e1e1614656d888a857f450f4315dcaa669569c42 diff --git a/repos/libports/src/app/avplay/avplay.patch b/repos/libports/src/app/avplay/avplay.patch index c0b836d73..ed85bbf27 100644 --- a/repos/libports/src/app/avplay/avplay.patch +++ b/repos/libports/src/app/avplay/avplay.patch @@ -1,8 +1,9 @@ - don't show status messages - fix audio/video synchronicity (needs more testing) +- override requested video mode with size of the framebuffer +++ src/lib/libav/avplay.c -@@ -235,7 +235,7 @@ +@@ -240,7 +240,7 @@ }; static int seek_by_bytes = -1; static int display_disable; @@ -11,8 +12,25 @@ static int av_sync_type = AV_SYNC_AUDIO_MASTER; static int64_t start_time = AV_NOPTS_VALUE; static int64_t duration = AV_NOPTS_VALUE; -@@ -965,7 +965,7 @@ - 2 * is->audio_st->codec->channels; +@@ -902,6 +902,16 @@ + && is->height== screen->h && screen->h == h) + return 0; + ++ /* override geometry with framebuffer size */ ++ SDL_Rect **modes = SDL_ListModes(NULL, flags); ++ if (modes == (SDL_Rect**)0) { ++ fprintf(stderr, "SDL: could not get mode list - exiting\n"); ++ return -1; ++ } ++ ++ w = modes[0]->w; ++ h = modes[0]->h; ++ + #if defined(__APPLE__) && !SDL_VERSION_ATLEAST(1, 2, 14) + /* setting bits_per_pixel = 0 or 32 causes blank video on OS X and older SDL */ + screen = SDL_SetVideoMode(w, h, 24, flags); +@@ -962,7 +972,7 @@ + av_get_bytes_per_sample(is->sdl_sample_fmt); } if (bytes_per_sec) - pts -= (double)hw_buf_size / bytes_per_sec;