[vlc-commits] chromecast: Fix transcode chain creation

Hugo Beauzée-Luyssen git at videolan.org
Tue Feb 21 14:00:58 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Feb 20 15:30:51 2017 +0100| [ad0773722b018cbbe23e67efc747610fa6973dab] | committer: Hugo Beauzée-Luyssen

chromecast: Fix transcode chain creation

5ee8e52 introduced a regression which caused video codec never to be
transcoded

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ad0773722b018cbbe23e67efc747610fa6973dab
---

 modules/stream_out/chromecast/cast.cpp | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index e3de881..874c563 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -252,30 +252,28 @@ int sout_stream_sys_t::UpdateOutput( sout_stream_t *p_stream )
         std::stringstream ssout;
         if ( !canRemux )
         {
-            if ( i_codec_audio == 0 )
-                i_codec_audio = DEFAULT_TRANSCODE_AUDIO;
-            /* avcodec AAC encoder is experimental */
-            if ( i_codec_audio == VLC_CODEC_MP4A ||
-                 i_codec_audio == VLC_FOURCC('h', 'a', 'a', 'c') ||
-                 i_codec_audio == VLC_FOURCC('l', 'a', 'a', 'c') ||
-                 i_codec_audio == VLC_FOURCC('s', 'a', 'a', 'c'))
-                i_codec_audio = DEFAULT_TRANSCODE_AUDIO;
-
-            if ( i_codec_video == 0 )
-                i_codec_video = DEFAULT_TRANSCODE_VIDEO;
-
             /* TODO: provide audio samplerate and channels */
             ssout << "transcode{";
             char s_fourcc[5];
-            if ( canDecodeAudio( i_codec_audio ) == false )
+            if ( i_codec_audio == 0 )
             {
+                /* avcodec AAC encoder is experimental */
+                if ( i_codec_audio == 0 ||
+                        i_codec_audio == VLC_CODEC_MP4A ||
+                        i_codec_audio == VLC_FOURCC('h', 'a', 'a', 'c') ||
+                        i_codec_audio == VLC_FOURCC('l', 'a', 'a', 'c') ||
+                        i_codec_audio == VLC_FOURCC('s', 'a', 'a', 'c'))
+                    i_codec_audio = DEFAULT_TRANSCODE_AUDIO;
+                msg_Dbg( p_stream, "Converting audio to %.4s", (const char*)&i_codec_audio );
                 ssout << "acodec=";
                 vlc_fourcc_to_char( i_codec_audio, s_fourcc );
                 s_fourcc[4] = '\0';
                 ssout << s_fourcc << ',';
             }
-            if ( b_has_video && canDecodeVideo( i_codec_video ) == false )
+            if ( b_has_video && i_codec_video == 0 )
             {
+                i_codec_video = DEFAULT_TRANSCODE_VIDEO;
+                msg_Dbg( p_stream, "Converting video to %.4s", (const char*)&i_codec_video );
                 /* TODO: provide maxwidth,maxheight */
                 ssout << "vcodec=";
                 vlc_fourcc_to_char( i_codec_video, s_fourcc );



More information about the vlc-commits mailing list