[vlc-commits] commit: Use MiB rather than MB for arbitrary memory limits ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Mar 3 16:57:55 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Mar  3 17:48:51 2010 +0200| [2d692952142354a7a91e10048a0dc8f0ca95ec6e] | committer: Rémi Denis-Courmont 

Use MiB rather than MB for arbitrary memory limits

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

 modules/stream_out/record.c |    8 ++++----
 src/input/decoder.c         |    4 ++--
 src/input/es_out.c          |    6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index 88f6ce1..2eb5420 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -148,11 +148,11 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_date_start = -1;
     p_sys->i_size = 0;
 #ifdef OPTIMIZE_MEMORY
-    p_sys->i_max_wait = 5*1000000; /* 5s */
-    p_sys->i_max_size = 1*1000000; /* 1 Mbyte */
+    p_sys->i_max_wait = 5*CLOCK_FREQ; /* 5s */
+    p_sys->i_max_size = 1*1024*1024; /* 1 MiB */
 #else
-    p_sys->i_max_wait = 30*1000000; /* 30s */
-    p_sys->i_max_size = 20*1000000; /* 20 Mbyte */
+    p_sys->i_max_wait = 30*CLOCK_FREQ; /* 30s */
+    p_sys->i_max_size = 20*1024*1024; /* 20 MiB */
 #endif
     p_sys->b_drop = false;
     p_sys->i_dts_start = 0;
diff --git a/src/input/decoder.c b/src/input/decoder.c
index a8bd0e4..1aad25e 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -369,9 +369,9 @@ void input_DecoderDecode( decoder_t *p_dec, block_t *p_block, bool b_do_pace )
             block_FifoPace( p_owner->p_fifo, 10, SIZE_MAX );
     }
 #ifdef __arm__
-    else if( block_FifoSize( p_owner->p_fifo ) > 50000000 /* 50 MB */ )
+    else if( block_FifoSize( p_owner->p_fifo ) > 50*1024*1024 /* 50 MiB */ )
 #else
-    else if( block_FifoSize( p_owner->p_fifo ) > 400000000 /* 400 MB, ie ~ 50mb/s for 60s */ )
+    else if( block_FifoSize( p_owner->p_fifo ) > 400*1024*1024 /* 400 MiB, ie ~ 50mb/s for 60s */ )
 #endif
     {
         /* FIXME: ideally we would check the time amount of data
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 3062d8e..81bdbbf 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -734,13 +734,13 @@ static bool EsOutIsExtraBufferingAllowed( es_out_t *out )
         if( p_es->p_dec_record )
             i_size += input_DecoderGetFifoSize( p_es->p_dec_record );
     }
-    //fprintf( stderr, "----- EsOutIsExtraBufferingAllowed =% 5d kbytes -- ", i_size / 1024 );
+    //msg_Info( out, "----- EsOutIsExtraBufferingAllowed =% 5d KiB -- ", i_size / 1024 );
 
     /* TODO maybe we want to be able to tune it ? */
 #if defined(OPTIMIZE_MEMORY)
-    const size_t i_level_high = 500000;  /* 0.5 Mbytes */
+    const size_t i_level_high = 512*1024;  /* 0.5 MiB */
 #else
-    const size_t i_level_high = 10000000; /* 10 Mbytes */
+    const size_t i_level_high = 10*1024*1024; /* 10 MiB */
 #endif
     return i_size < i_level_high;
 }



More information about the vlc-commits mailing list