[vlc-devel] [PATCH 2/2] libmp4: Move variable declaration to avoid unused variable warning

Diego Biurrun diego at biurrun.de
Tue Dec 9 16:58:08 CET 2014


demux/mp4/libmp4.c:858:12: warning: variable ‘translate’ set but not used [-Wunused-but-set-variable]
---
 modules/demux/mp4/libmp4.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 45b54c2..48f4fdb 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -855,13 +855,8 @@ static int MP4_ReadBox_tkhd(  stream_t *p_stream, MP4_Box_t *p_box )
 
     double rotation;    //angle in degrees to be rotated clockwise
     double scale[2];    // scale factor; sx = scale[0] , sy = scale[1]
-    double translate[2];// amount to translate; tx = translate[0] , ty = translate[1]
-
     int32_t *matrix = p_box->data.p_tkhd->i_matrix;
 
-    translate[0] = conv_fx(matrix[6]);
-    translate[1] = conv_fx(matrix[7]);
-
     scale[0] = sqrt(conv_fx(matrix[0]) * conv_fx(matrix[0]) +
                     conv_fx(matrix[3]) * conv_fx(matrix[3]));
     scale[1] = sqrt(conv_fx(matrix[1]) * conv_fx(matrix[1]) +
@@ -875,6 +870,11 @@ static int MP4_ReadBox_tkhd(  stream_t *p_stream, MP4_Box_t *p_box )
     p_box->data.p_tkhd->f_rotation = rotation;
 
 #ifdef MP4_VERBOSE
+    double translate[2];// amount to translate; tx = translate[0] , ty = translate[1]
+
+    translate[0] = conv_fx(matrix[6]);
+    translate[1] = conv_fx(matrix[7]);
+
     MP4_ConvertDate2Str( s_creation_time, p_box->data.p_mvhd->i_creation_time, false );
     MP4_ConvertDate2Str( s_modification_time, p_box->data.p_mvhd->i_modification_time, false );
     MP4_ConvertDate2Str( s_duration, p_box->data.p_mvhd->i_duration, true );
-- 
2.1.0




More information about the vlc-devel mailing list