From 573a57de1cd5d4f705d990677d6167eb17eca687 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 24 Jan 2010 15:19:14 +0000 Subject: Reset the parser on seek. Should fix some cases of audio "blips" after seeking. AC3 is still broken due to the libavcodec parser being broken. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30421 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_ffmpeg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index c9f557bcb2..d525f28ede 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -153,6 +153,7 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...) switch(cmd){ case ADCTRL_RESYNC_STREAM: avcodec_flush_buffers(lavc_context); + ds_clear_parser(sh->ds); return CONTROL_TRUE; } return CONTROL_UNKNOWN; -- cgit v1.2.3 From fb8c6688c96a64ee464d6d3eae5716a8e6bb081f Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 24 Jan 2010 20:46:26 +0000 Subject: Fail ad_pcm initialization of WAVEFORMATEX header is missing instead of crashing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30428 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_pcm.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libmpcodecs') diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c index 20f33e14dc..e619793b86 100644 --- a/libmpcodecs/ad_pcm.c +++ b/libmpcodecs/ad_pcm.c @@ -21,6 +21,8 @@ LIBAD_EXTERN(pcm) static int init(sh_audio_t *sh_audio) { WAVEFORMATEX *h=sh_audio->wf; + if (!h) + return 0; sh_audio->i_bps=h->nAvgBytesPerSec; sh_audio->channels=h->nChannels; sh_audio->samplerate=h->nSamplesPerSec; -- cgit v1.2.3 From d83fb575cf06d8921758ce1fe2b20320a93d159b Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 26 Jan 2010 18:15:58 +0000 Subject: Add an option to cropdetect to periodically reset the detected area. Patch by [quetschke scytek de] with modifications by me. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30436 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vf_cropdetect.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/vf_cropdetect.c b/libmpcodecs/vf_cropdetect.c index d0d4eb489a..7a1080b719 100644 --- a/libmpcodecs/vf_cropdetect.c +++ b/libmpcodecs/vf_cropdetect.c @@ -15,6 +15,7 @@ struct vf_priv_s { int x1,y1,x2,y2; int limit; int round; + int reset_count; int fno; }; @@ -49,7 +50,7 @@ static int config(struct vf_instance_s* vf, vf->priv->y1=height - 1; vf->priv->x2=0; vf->priv->y2=0; - vf->priv->fno=0; + vf->priv->fno=-2; return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } @@ -72,7 +73,16 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ dmpi->width=mpi->width; dmpi->height=mpi->height; -if(++vf->priv->fno>2){ // ignore first 2 frames - they may be empty +if(++vf->priv->fno>0){ // ignore first 2 frames - they may be empty + + // Reset the crop area every reset_count frames, if reset_count is > 0 + if(vf->priv->reset_count > 0 && vf->priv->fno > vf->priv->reset_count){ + vf->priv->x1=mpi->w-1; + vf->priv->y1=mpi->h-1; + vf->priv->x2=0; + vf->priv->y2=0; + vf->priv->fno=1; + } for(y=0;ypriv->y1;y++){ if(checkline(mpi->planes[0]+mpi->stride[0]*y,bpp,mpi->w,bpp)>vf->priv->limit){ @@ -153,9 +163,11 @@ static int open(vf_instance_t *vf, char* args){ vf->priv=malloc(sizeof(struct vf_priv_s)); vf->priv->limit=24; // should be option vf->priv->round = 0; - if(args) sscanf(args, "%d:%d", + vf->priv->reset_count = 0; + if(args) sscanf(args, "%d:%d:%d", &vf->priv->limit, - &vf->priv->round); + &vf->priv->round, + &vf->priv->reset_count); return 1; } -- cgit v1.2.3