[vlc-commits] libmp4: Move variable declaration to avoid unused variable warning

Diego Biurrun git at videolan.org
Tue Dec 9 19:12:10 CET 2014


vlc | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Dec  9 16:58:08 2014 +0100| [446225d19f2f22c6d2c7c5f831421fa2976bbe81] | committer: Jean-Baptiste Kempf

libmp4: Move variable declaration to avoid unused variable warning

demux/mp4/libmp4.c:858:12: warning: variable ‘translate’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 );



More information about the vlc-commits mailing list