[vlc-devel] [PATCH] chromecast: resize large resolution videos

Erick Tyndall erythros at gmail.com
Sat Sep 29 05:52:49 CEST 2018


1080p and lower resolution videos correctly scale/resize during
transcoding. This patch corrects the resizing of videos that exceed
1080p.
---
 modules/stream_out/chromecast/cast.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/chromecast/cast.cpp
b/modules/stream_out/chromecast/cast.cpp
index 2ef26d8eb4..fd688df343 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -1129,14 +1129,17 @@ sout_stream_sys_t::GetVcodecOption(
sout_stream_t *p_stream, vlc_fourcc_t *p_cod

     ssout << GetVencOption( p_stream, p_codec_video, p_vid, i_quality );

+    es_format_t fmt;
+    es_format_InitFromVideo( &fmt, p_vid );
+
     switch ( i_quality )
     {
         case CONVERSION_QUALITY_HIGH:
         case CONVERSION_QUALITY_MEDIUM:
-            ssout << video_maxres_hd << ',';
+            ssout << ((fmt.video.i_width > 1920) ? "width=1920," :
"") << video_maxres_hd << ',';
             break;
         default:
-            ssout << video_maxres_720p << ',';
+            ssout << ((fmt.video.i_width > 1280) ? "width=1280," :
"") << video_maxres_720p << ',';
     }

     if( p_vid == NULL
-- 
2.17.1


More information about the vlc-devel mailing list