From 03e013a6b77ddf7fa0fe99af77803d3e6071ff6d Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Tue, 3 Jul 2018 17:10:09 +0200 Subject: [PATCH] chromecast: always set vb value for vtenc Since this value is handled as a max rate. --- modules/stream_out/chromecast/cast.cpp | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp index b775c5fec7..8830f57cad 100644 --- a/modules/stream_out/chromecast/cast.cpp +++ b/modules/stream_out/chromecast/cast.cpp @@ -1016,26 +1016,22 @@ static std::string GetVencAvcodecVTOption( sout_stream_t * /* p_stream */, const video_format_t * p_vid, int i_quality ) { - const bool b_hdres = p_vid == NULL || p_vid->i_height == 0 || p_vid->i_height >= 800; std::stringstream ssout; ssout << "venc=avcodec{codec=h264_videotoolbox,options{realtime=1}}"; - if( b_hdres ) + switch( i_quality ) { - switch( i_quality ) - { - /* Here, performances issues won't come from videotoolbox but from - * some old chromecast devices */ + /* Here, performances issues won't come from videotoolbox but from + * some old chromecast devices */ - case CONVERSION_QUALITY_HIGH: - break; - case CONVERSION_QUALITY_MEDIUM: - ssout << ",vb=8000000"; - break; - case CONVERSION_QUALITY_LOW: - case CONVERSION_QUALITY_LOWCPU: - ssout << ",vb=3000000"; - break; - } + case CONVERSION_QUALITY_HIGH: + break; + case CONVERSION_QUALITY_MEDIUM: + ssout << ",vb=8000000"; + break; + case CONVERSION_QUALITY_LOW: + case CONVERSION_QUALITY_LOWCPU: + ssout << ",vb=3000000"; + break; } return ssout.str(); -- 2.11.4.GIT