[MPlayer-dev-eng] [PATCH] improve dvd subtitle. cmd 7 (CHG_COLCON)

Diego Biurrun diego at biurrun.de
Wed Mar 10 23:45:47 CET 2010


On Sun, Mar 07, 2010 at 07:29:50PM +0900, A Tanaka wrote:
> On Thu, 04 Mar 2010 14:23:41 +0100
> Diego Biurrun <diego at biurrun.de> wrote:
> > Could you split this patch into separate parts?  Thank you.
> 
> splitted.

Thanks.

> --- spudec.c.org
> +++ spudec.c
> @@ -441,7 +442,8 @@
>        case 0xff:
>  	/* All done, bye-bye */
>  	mp_msg(MSGT_SPUDEC,MSGL_DBG2,"Done!\n");
> -	return;
> +	goto next_control;
> +//	return;
>  //	break;

Please don't add (more) commented-out cruft.

> @@ -450,11 +452,18 @@
>        }
>      }
>    next_control:
> -    if (!display)
> +    mp_msg(MSGT_SPUDEC,MSGL_DBG2,"exit cmd loop: %d->%d(%d)\n", start_pts, end_pts, display);

extra good karma for keeping lines below 80 characters

> --- spudec.c.org
> +++ spudec.c
> @@ -245,19 +205,29 @@
>  
> +    if (this->imagebuf != NULL)

if (this->imagebuf)

> +    this->imagebuf_size = 2 * this->image_size;
> +    this->imagebuf = malloc(this->imagebuf_size);

This could be aligned.

> +    if (NULL == this->imagebuf)

The order of the comparison feels backwards.  Just use

if (!this->imagebuf)

> +  if (this->image_size == 0 || this->imagebuf == NULL) {
> +    this->height = 0;
> +    this->image_size = 0;
> +    this->image = NULL;
> +    this->aimage = NULL;
>      return;
> +  }
> +
> +  this->image = this->imagebuf;
> +  this->aimage = this->imagebuf + this->image_size;

These could be aligned as well, more below.

Diego



More information about the MPlayer-dev-eng mailing list