[vlc-devel] commit: Fix divide by 0 when repacketizing a Flac stream of known rate ( David Flynn )

git version control git at videolan.org
Sat Aug 23 18:43:55 CEST 2008


vlc | branch: master | David Flynn <davidf at rd.bbc.co.uk> | Sat Aug 23 16:17:24 2008 +0000| [c18dbcc9602a6c2f5dc5b87284fa9dc4f7fdfe9a] | committer: Antoine Cellerier 

Fix divide by 0 when repacketizing a Flac stream of known rate

Before setting end_date, remember to initialize the divider for future
calculations.

Signed-off-by: David Flynn <davidf at rd.bbc.co.uk>
Signed-off-by: Antoine Cellerier <dionoea at videolan.org>

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

 modules/codec/flac.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index 0fb3d01..65e798e 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -408,6 +408,8 @@ static block_t *PacketizeBlock( decoder_t *p_dec, block_t **pp_block )
     else if( !aout_DateGet( &p_sys->end_date ) )
     {
         /* The first PTS is as good as anything else. */
+        p_sys->i_rate = p_dec->fmt_out.audio.i_rate;
+        aout_DateInit( &p_sys->end_date, p_sys->i_rate );
         aout_DateSet( &p_sys->end_date, (*pp_block)->i_pts );
     }
 




More information about the vlc-devel mailing list