[MPlayer-dev-eng] Mplayer -vo ps3

Diego Biurrun diego at biurrun.de
Sun Apr 5 15:29:19 CEST 2009


On Sun, Apr 05, 2009 at 02:28:39AM +0200, Kristian Jerpetjøn wrote:
> 2009/4/4 Diego Biurrun <diego at biurrun.de>:
> > On Sat, Apr 04, 2009 at 10:26:33PM +0200, Kristian Jerpetjøn wrote:
> >>
> >> +    for ( i=0; i<2; i++ )
> >> +    {
> >> +        snapshot = fopen ( inbuf_file[i], "wb" );
> >
> > K&R for new files please, i.e. no space between function name and
> > opening parenthesis, opening { on the same line as the for/if/while.
> 
> attempted to fix
> my dysleksia could leave loads of blanks sorry for those

Many instances do indeed remain.  Please go through your code and remove
spaces between function names and (, but place a space between
if/for/while/switch and (.

Keep the { on the same line with if/for/while/switch, but place it on
the next line for function declarations.

> 
> --- libvo/vo_ps3.c	(revision 0)
> +++ libvo/vo_ps3.c	(revision 0)
> @@ -0,0 +1,744 @@
> +
> +static vo_info_t info =
> +{

Keep the { on the same line, same below.

> +    mp_msg(MSGT_VO, MSGL_INFO,
> +           "[vo_ps3] snapshot: wrote current inbuf_*[]"
> +           "to inbuf0.yuv & inbuf1.yuv\n");

Here and in other places: Why split this into so many lines?

> +    //TODO Understand what bill was trying to do here
> +    //not (mpi->flags & MP_IMGFLAG_DIRECT) (no -dr flag for direct rendering),
> +    // may need to handle MP_IMGFLAG_READABLE IPB (B) frames differently
> +    // When direct rendering is enabled (-dr), I moved the B frames to a
> +    // non-direct
> +    // buffer and then when drawn with draw_image, they (seem) to work fine
> +    // BUT, without direct rendering, don't know how to handle them :(
> +    // Just drawing them as called makes a mess of the video.
> +
> +  //  if ( ( mpi->flags & MP_IMGFLAG_READABLE ) &&
> +  //          ( mpi->type == MP_IMGTYPE_IPB || mpi->type == MP_IMGTYPE_IP ) )
> +  //  {
> +  //      buf_plane_ptr[0] = inbuf_y[page];
> +  //      buf_plane_ptr[1] = inbuf_u[page];
> +  //      buf_plane_ptr[2] = inbuf_v[page];
> +  //  }
> +  //  else
> +  //  {
> +        buf_plane_ptr[0] = inbuf_y[page];
> +        buf_plane_ptr[1] = inbuf_u[page];
> +        buf_plane_ptr[2] = inbuf_v[page];
> +  //  }
> +
> +
> +  //  draw_slice(mpi->planes, buf_plane_ptr,mpi->w, mpi->h, 0, 0);

Please leave out debug code.

> +    for (i = 0; i < 3; i++){
> +
> +        memcpy_pic(buf_plane_ptr[i], mpi->planes[i], mpi_p_w[i],
> +                    mpi_p_h[i], src_stride[i], mpi->stride[i]);
> +    }

Pointless {} and why do you leave one line empty here and in many other
similar places?

> +/**
> + * Toggles fullscreen off and on

End sentences in a period, same everywhere.

> +    for ( i=0; i<NUM_BUFFERS; i++ ) {

Sometimes you have spaces after the opening (, sometimes you don't.  I
suggest you drop all of them.

Diego



More information about the MPlayer-dev-eng mailing list