[MPlayer-dev-eng] [PATCH] audio pts handling cleanups
Reimar Doeffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon May 15 14:06:47 CEST 2006
Hi,
If you can, please send patches as text/plain, at least I can't get mutt
to include other attachments in the reply automatically.
On Mon, May 15, 2006 at 01:25:06AM +0300, Uoti Urpala wrote:
> The patch cleans up pts handling in the sync code and makes the
> currently inconsistent audio pts handling in the audio-only case work
> the same as with video. It could use some testing, especially for
> seeking in various audio-only files/streams. I intend to commit it after
> the release.
> @@ -3913,13 +3964,9 @@
> current_module="av_sync";
>
> if(sh_audio){
> - double a_pts=0;
> - double v_pts=0;
> -
> - // unplayed bytes in our and soundcard/dma buffer:
> - float
> delay=playback_speed*audio_out->get_delay()+(float)sh_audio->a_buffer_len/(float)sh_audio->o_bps;
> + double a_pts, v_pts;
cosmetics, just leave the a_pts and v_pts declarations as before
> - pos = sh_audio->delay - audio_out->get_delay() *
> playback_speed;
> + pos = playing_audio_pts(sh_audio, d_audio, audio_out);
You are using a tab here, the surrounding code does not.
> --- libmpdemux/demux_asf.c 30 Mar 2006 23:06:18 -0000 1.47
> +++ libmpdemux/demux_asf.c 14 May 2006 22:01:01 -0000
> @@ -397,7 +397,7 @@
> }
>
> if (d_video->id < 0)
> - sh_audio->delay = d_audio->pts;
> + ;
> else
> while(1){
IMHO this is taking the no-cosmetics rule to far, I'm just not sure if
> if (d_video->id >= 0)
> while (1){
or
> while (d_video->id >= 0){
would be preferable.
> @@ -680,13 +678,10 @@
>
> if(demuxer->movi_end && pos >= demuxer->movi_end) {
> pos = demuxer->movi_end;
> - //sh_audio->delay = (stream_tell(s) -
> demuxer->movi_start)/(float)sh_audio->i_bps;
> - //return;
removing that //return; is unrelated.
If it works it should be okay apart from these :-)
Greetings,
Reimar Doeffinger
More information about the MPlayer-dev-eng
mailing list