[vlc-devel] commit: Do not assert on non 0 divider in aout_DateInit. (Laurent Aimar )

git version control git at videolan.org
Fri Oct 10 21:28:57 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Oct 10 19:45:53 2008 +0200| [0b2d112a88c3cee1f73b5281b2453537268329a8] | committer: Laurent Aimar 

Do not assert on non 0 divider in aout_DateInit.

A lot of codecs do init it to 0 and fix it later.

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

 src/audio_output/common.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index f8dc727..771419d 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -479,7 +479,6 @@ void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
  *****************************************************************************/
 void aout_DateInit( audio_date_t * p_date, uint32_t i_divider )
 {
-    assert (i_divider);
     p_date->date = 0;
     p_date->i_divider = i_divider;
     p_date->i_remainder = 0;
@@ -517,7 +516,7 @@ mtime_t aout_DateGet( const audio_date_t * p_date )
 mtime_t aout_DateIncrement( audio_date_t * p_date, uint32_t i_nb_samples )
 {
     mtime_t i_dividend = INT64_C(1000000) * i_nb_samples;
-    assert (p_date->i_divider); /* uninitialized audio_data_t ? */
+    assert( p_date->i_divider > 0 ); /* uninitialized audio_data_t ? */
     p_date->date += i_dividend / p_date->i_divider;
     p_date->i_remainder += (int)(i_dividend % p_date->i_divider);
     if ( p_date->i_remainder >= p_date->i_divider )




More information about the vlc-devel mailing list