Mercurial > mplayer.hg
comparison mplayer.c @ 7749:48bf03297d48
more accurate a_pts calculation in AVI -bps (default) mode
author | arpi |
---|---|
date | Wed, 16 Oct 2002 14:51:15 +0000 |
parents | 197cee6aa59e |
children | 27c9c440536f |
comparison
equal
deleted
inserted
replaced
7748:18f7389bc822 | 7749:48bf03297d48 |
---|---|
1666 if(pts_from_bps){ | 1666 if(pts_from_bps){ |
1667 // PTS = sample_no / samplerate | 1667 // PTS = sample_no / samplerate |
1668 unsigned int samples= | 1668 unsigned int samples= |
1669 // (sh_audio->audio.dwSampleSize)? | 1669 // (sh_audio->audio.dwSampleSize)? |
1670 // ((ds_tell(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->audio.dwSampleSize) : | 1670 // ((ds_tell(d_audio)-sh_audio->a_in_buffer_len)/sh_audio->audio.dwSampleSize) : |
1671 (d_audio->block_no); // <- used for VBR audio | 1671 ds_tell_block(d_audio); // <- used for VBR audio |
1672 samples+=sh_audio->audio.dwStart; // offset | 1672 samples+=sh_audio->audio.dwStart; // offset |
1673 a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate; | 1673 a_pts=samples*(float)sh_audio->audio.dwScale/(float)sh_audio->audio.dwRate; |
1674 delay_corrected=1; | 1674 delay_corrected=1; |
1675 a_pts-=(sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; | |
1675 } else { | 1676 } else { |
1676 // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec) | 1677 // PTS = (last timestamp) + (bytes after last timestamp)/(bytes per sec) |
1677 a_pts=d_audio->pts; | 1678 a_pts=d_audio->pts; |
1678 if(!delay_corrected) if(a_pts) delay_corrected=1; | 1679 if(!delay_corrected) if(a_pts) delay_corrected=1; |
1679 #if 0 | 1680 #if 0 |