[vlc-commits] transcode: reindent and clean transcode_video_set_conversions

Steve Lhomme git at videolan.org
Mon Oct 5 14:05:20 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Oct  5 13:47:44 2020 +0200| [9bf45f3eaa77e9220eea7be3046e76fc5d1bec0a] | committer: Steve Lhomme

transcode: reindent and clean transcode_video_set_conversions

The last b_do_orient test is done without a local variable.

No functional changes.

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

 modules/stream_out/transcode/video.c | 62 ++++++++++++++++--------------------
 1 file changed, 27 insertions(+), 35 deletions(-)

diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 0675e9bdc4..c031c35c71 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -279,49 +279,41 @@ static int transcode_video_set_conversions( sout_stream_t *p_stream,
         .sys = id,
     };
 
-    {
-        const bool b_do_scale = (*pp_src)->video.i_width != p_dst->video.i_width ||
-                                (*pp_src)->video.i_height != p_dst->video.i_height;
-        const bool b_do_chroma = (*pp_src)->video.i_chroma != p_dst->video.i_chroma;
-        const bool b_do_orient = ((*pp_src)->video.orientation != ORIENT_NORMAL) && b_reorient;
-
-        const es_format_t *p_tmpdst = p_dst;
+    const bool b_do_scale = (*pp_src)->video.i_width != p_dst->video.i_width ||
+                            (*pp_src)->video.i_height != p_dst->video.i_height;
+    const bool b_do_chroma = (*pp_src)->video.i_chroma != p_dst->video.i_chroma;
+    const bool b_do_orient = ((*pp_src)->video.orientation != ORIENT_NORMAL) && b_reorient;
 
-        if( ! (b_do_scale || b_do_chroma || b_do_orient) )
-            return VLC_SUCCESS;
+    const es_format_t *p_tmpdst = p_dst;
 
-        es_format_t tmpdst;
-        if( b_do_orient )
-        {
-            es_format_Init( &tmpdst, VIDEO_ES, p_dst->video.i_chroma );
-            video_format_ApplyRotation( &tmpdst.video, &p_dst->video );
-            p_tmpdst = &tmpdst;
-        }
+    if( ! (b_do_scale || b_do_chroma || b_do_orient) )
+        return VLC_SUCCESS;
 
-        msg_Dbg( p_stream, "adding (scale %d,chroma %d, orient %d) converters",
-                 b_do_scale, b_do_chroma, b_do_orient );
+    es_format_t tmpdst;
+    if( b_do_orient )
+    {
+        es_format_Init( &tmpdst, VIDEO_ES, p_dst->video.i_chroma );
+        video_format_ApplyRotation( &tmpdst.video, &p_dst->video );
+        p_tmpdst = &tmpdst;
+    }
 
-        id->p_conv_nonstatic = filter_chain_NewVideo( p_stream, true, &owner );
-        if( !id->p_conv_nonstatic )
-            return VLC_EGENERIC;
-        filter_chain_Reset( id->p_conv_nonstatic, *pp_src, *pp_src_vctx, p_tmpdst );
+    msg_Dbg( p_stream, "adding (scale %d,chroma %d, orient %d) converters",
+                b_do_scale, b_do_chroma, b_do_orient );
 
-        if( filter_chain_AppendConverter( id->p_conv_nonstatic, p_tmpdst ) != VLC_SUCCESS )
-            return VLC_EGENERIC;
+    id->p_conv_nonstatic = filter_chain_NewVideo( p_stream, true, &owner );
+    if( !id->p_conv_nonstatic )
+        return VLC_EGENERIC;
+    filter_chain_Reset( id->p_conv_nonstatic, *pp_src, *pp_src_vctx, p_tmpdst );
 
-        *pp_src = filter_chain_GetFmtOut( id->p_conv_nonstatic );
-        *pp_src_vctx = filter_chain_GetVideoCtxOut( id->p_conv_nonstatic );
-        debug_format( p_stream, *pp_src );
-    }
-    {
-        const bool b_do_orient = ((*pp_src)->video.orientation != ORIENT_NORMAL) && b_reorient;
+    if( filter_chain_AppendConverter( id->p_conv_nonstatic, p_tmpdst ) != VLC_SUCCESS )
+        return VLC_EGENERIC;
 
-        if( b_do_orient )
-            return VLC_EGENERIC;
+    *pp_src = filter_chain_GetFmtOut( id->p_conv_nonstatic );
+    *pp_src_vctx = filter_chain_GetVideoCtxOut( id->p_conv_nonstatic );
+    debug_format( p_stream, *pp_src );
 
-        if( !b_do_orient )
-            return VLC_SUCCESS;
-    }
+    if( ((*pp_src)->video.orientation != ORIENT_NORMAL) && b_reorient )
+        return VLC_EGENERIC;
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list