[vlc-commits] demux: mp4: use define for block size
Francois Cartegnie
git at videolan.org
Fri Apr 4 08:53:54 CEST 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Apr 4 08:44:17 2014 +0200| [5b24b0b6f58b211c9f8642f77d50603363a0a850] | committer: Francois Cartegnie
demux: mp4: use define for block size
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5b24b0b6f58b211c9f8642f77d50603363a0a850
---
modules/demux/mp4/libmp4.c | 10 +++++-----
modules/demux/mp4/libmp4.h | 2 ++
modules/demux/mp4/mp4.c | 4 ++--
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 90489da..222313e 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -838,8 +838,8 @@ static int MP4_ReadBox_tkhd( stream_t *p_stream, MP4_Box_t *p_box )
scale[1],
translate[0],
translate[1],
- (float)p_box->data.p_tkhd->i_width / 65536,
- (float)p_box->data.p_tkhd->i_height / 65536,
+ (float)p_box->data.p_tkhd->i_width / BLOCK16x16,
+ (float)p_box->data.p_tkhd->i_height / BLOCK16x16,
p_box->data.p_tkhd->i_matrix[0],
p_box->data.p_tkhd->i_matrix[1],
p_box->data.p_tkhd->i_matrix[2],
@@ -1665,8 +1665,8 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
memcpy( &f_sample_rate, &dummy, 8 );
msg_Dbg( p_stream, "read box: %f Hz", f_sample_rate );
- p_box->data.p_sample_soun->i_sampleratehi = (int)f_sample_rate % 65536;
- p_box->data.p_sample_soun->i_sampleratelo = f_sample_rate / 65536;
+ p_box->data.p_sample_soun->i_sampleratehi = (int)f_sample_rate % BLOCK16x16;
+ p_box->data.p_sample_soun->i_sampleratelo = f_sample_rate / BLOCK16x16;
MP4_GET4BYTES( i_channel );
p_box->data.p_sample_soun->i_channelcount = i_channel;
@@ -1712,7 +1712,7 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
p_box->data.p_sample_soun->i_channelcount,
p_box->data.p_sample_soun->i_samplesize,
(float)p_box->data.p_sample_soun->i_sampleratehi +
- (float)p_box->data.p_sample_soun->i_sampleratelo / 65536 );
+ (float)p_box->data.p_sample_soun->i_sampleratelo / BLOCK16x16 );
#endif
MP4_READBOX_EXIT( 1 );
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index aac5e3f..8990311 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -25,6 +25,8 @@
#include <vlc_es.h>
+#define BLOCK16x16 (1<<16)
+
#define ATOM_root VLC_FOURCC( 'r', 'o', 'o', 't' )
#define ATOM_uuid VLC_FOURCC( 'u', 'u', 'i', 'd' )
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 1beb50a..10a2ae8 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -2607,8 +2607,8 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
p_track->i_track_ID = p_tkhd->data.p_tkhd->i_track_ID;
- p_track->i_width = p_tkhd->data.p_tkhd->i_width / 65536;
- p_track->i_height = p_tkhd->data.p_tkhd->i_height / 65536;
+ p_track->i_width = p_tkhd->data.p_tkhd->i_width / BLOCK16x16;
+ p_track->i_height = p_tkhd->data.p_tkhd->i_height / BLOCK16x16;
p_track->f_rotation = p_tkhd->data.p_tkhd->f_rotation;
if( p_tref )
More information about the vlc-commits
mailing list