[vlc-devel] commit: assert that audio date divider is non-nul, refs #2169 ( Rémi Denis-Courmont )
git version control
git at videolan.org
Thu Oct 9 20:03:13 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Thu Oct 9 21:01:29 2008 +0300| [6124f9823a490a0291e2604cd579b2e0e6c2c42f] | committer: Rémi Denis-Courmont
assert that audio date divider is non-nul, refs #2169
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6124f9823a490a0291e2604cd579b2e0e6c2c42f
---
src/audio_output/common.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index ef165fb..f8dc727 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -479,6 +479,7 @@ 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;
@@ -515,7 +516,8 @@ 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 = (mtime_t)i_nb_samples * 1000000;
+ mtime_t i_dividend = INT64_C(1000000) * i_nb_samples;
+ assert (p_date->i_divider); /* 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