[MPlayer-dev-eng] [PATCH] audio dropping

Oded Shimon ods15 at ods15.dyndns.org
Mon Nov 6 19:04:49 CET 2006


On Mon, Nov 06, 2006 at 06:52:23PM +0100, Reimar Döffinger wrote:
> Hello,
> the attached patch implements audio dropping if audio is too far behind
> video, e.g. when using -delay 10. This also (except for the large
> startup delay) fixes http://bugzilla.mplayerhq.hu/show_bug.cgi?id=609
> Like this it would be enabled by default, heavy testing will be needed
> to see if this is a good idea.
> If there are no objections I will apply soon.
> 
> Greetings,
> Reimar Döffinger

> Index: mplayer.c
> ===================================================================
> --- mplayer.c	(revision 20725)
> +++ mplayer.c	(working copy)
> @@ -312,6 +312,7 @@
>         float force_fps=0;
>  static int force_srate=0;
>  static int audio_output_format=0;
> +       int audio_dropping=1;

Why not static?...

>         int frame_dropping=0; // option  0=no drop  1= drop vo  2= drop decode
>  static int play_n_frames=-1;
>  static int play_n_frames_mf=-1;
> @@ -4093,6 +4096,9 @@
>        }
>        break;
>      }
> +    if (audio_dropping && (playback_speed*audio_out->get_delay() - sh_audio->delay) > 1.0)
> +      sh_audio->delay+=playback_speed*ret/(double)ao_data.bps;
> +    else
>      sh_audio->a_out_buffer_len+=ret;

Please make sure to make a seperate commit of reindenting this line :)

>    }
>    t=GetTimer()-t;
> Index: cfg-mplayer.h
> ===================================================================
> --- cfg-mplayer.h	(revision 20725)
> +++ cfg-mplayer.h	(working copy)
> @@ -305,6 +305,8 @@
>  	{"framedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL},
>  	{"hardframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 0, 2, NULL},
>  	{"noframedrop", &frame_dropping, CONF_TYPE_FLAG, 0, 1, 0, NULL},
> +	{"audiodrop", &audio_dropping, CONF_TYPE_FLAG, 0, 0, 1, NULL},
> +	{"noaudiodrop", &audio_dropping, CONF_TYPE_FLAG, 0, 1, 0, NULL},

And doc this up...

- ods15



More information about the MPlayer-dev-eng mailing list