changeset 7749:48bf03297d48

more accurate a_pts calculation in AVI -bps (default) mode
author arpi
date Wed, 16 Oct 2002 14:51:15 +0000
parents 18f7389bc822
children 3a2b4bf47dbc
files mplayer.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Wed Oct 16 14:50:45 2002 +0000
+++ b/mplayer.c	Wed Oct 16 14:51:15 2002 +0000
@@ -1668,10 +1668,11 @@
         unsigned int samples=
 //	  (sh_audio->audio.dwSampleSize)?
 //          ((ds_tell(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->audio.dwSampleSize) :
-          (d_audio->block_no); // <- used for VBR audio
+          ds_tell_block(d_audio); // <- used for VBR audio
 	samples+=sh_audio->audio.dwStart; // offset
         a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate;
 	delay_corrected=1;
+	a_pts-=(sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps;
     } else {
       // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec)
       a_pts=d_audio->pts;