[vlc-devel] [PATCH 04/12] bluray: Preparing menu handling.

Jean-Baptiste Kempf jb at videolan.org
Mon Jan 23 01:28:52 CET 2012


On Sun, Jan 22, 2012 at 12:30:59AM +0100, Hugo Beauzée-Luyssen wrote :
> +    add_bool( "bluray-menu", true, BD_MENU_TEXT, BD_MENU_LONGTEXT, false )

Make it false, for a start.

> -static int     blurayDemux  (demux_t *);
> +static int     blurayDemux(demux_t *);
Unrelated change.

> -    /* get title request */
> -    if ((pos_title = strrchr(bd_path, ':'))) {
> -        /* found character ':' for title information */
> -        *(pos_title++) = '\0';
> -        i_title = atoi(pos_title);
> +    bool    b_menu = var_CreateGetBool( p_demux, "bluray-menu" );
Are you sure that you do not want inherit here?
Also, weird styling.

> +    if ( b_menu )
> +    {
> +        //Starting playback from main menu
Weird comment.

> +    int nread;
>  
> +    //Handle events first.
>      blurayHandleEvents( p_demux );
> -    int nread = bd_read(p_sys->bluray, p_block->p_buffer,
> +
> +    nread = bd_read(p_sys->bluray, p_block->p_buffer,
Why the change of nread declaration?

> +static int blurayDemuxMenu( demux_t *p_demux )
> +{
> +    demux_sys_t *p_sys = p_demux->p_sys;
> +    BD_EVENT    e;
>  
> +    block_t     *p_block = block_New(p_demux, NB_TS_PACKETS * (int64_t)BD_TS_PACKET_SIZE);
> +    int         nread = bd_read_ext( p_sys->bluray, p_block->p_buffer,
> +                                      NB_TS_PACKETS * BD_TS_PACKET_SIZE, &e );
> +    if ( nread == 0 ) //We need to handle events before doing anything
> +    {
> +        if ( e.event == BD_EVENT_NONE )
> +            msg_Info( p_demux, "We reached the end of a title" );
> +        else
> +            blurayHandleEvent( p_demux, &e );
> +        block_Release(p_block);
> +        return 1;
> +    }
> +    if (nread < 0)
> +    {
> +        block_Release(p_block);
> +        return nread;
> +    }
> +    p_block->i_buffer = nread;
> +
> +    stream_DemuxSend( p_sys->p_parser, p_block );

OK, except the style.

Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list