[vlc-devel] [PATCH] AVI: add an automatic decision choice for AVI index

Rafaël Carré funman at videolan.org
Tue Jan 10 18:56:15 CET 2012


Le 2012-01-10 12:51, Jean-Baptiste Kempf a écrit :
> Propose a choice to automatically rebuild the index when broken...
> ---
>  modules/demux/avi/avi.c |   46 ++++++++++++++++++++++++++++------------------
>  1 files changed, 28 insertions(+), 18 deletions(-)
> 
> diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
> index 106bc43..e83c962 100644
> --- a/modules/demux/avi/avi.c
> +++ b/modules/demux/avi/avi.c
> @@ -63,7 +63,8 @@ static const int pi_index[] = {0,1,2};

This one shouldn't be updated?

>  
>  static const char *const ppsz_indexes[] = { N_("Ask for action"),
>                                              N_("Always fix"),
> -                                            N_("Never fix") };
> +                                            N_("Never fix"),
> +                                            N_("Automatically fix")};


Any problem if it replaces the 'always fix' option?

>  vlc_module_begin ()
>      set_shortname( "AVI" )
> @@ -666,29 +667,38 @@ aviindex:
>  
>          msg_Warn( p_demux, "broken or missing index, 'seek' will be "
>                             "approximative or will exhibit strange behavior" );
> -        if( i_do_index == 0 && !b_index )
> +        if( (i_do_index == 0 || i_do_index == 3) && !b_index )
>          {
>              if( !p_sys->b_seekable ) {
>                  b_index = true;
>                  goto aviindex;
>              }
> -            switch( dialog_Question( p_demux, _("Broken or missing AVI Index") ,
> -               _( "Because this AVI file index is broken or missing, "
> -                  "seeking will not work correctly.\n"
> -                  "VLC won't repair your file but can temporary fix this "
> -                  "problem by building an index in memory.\n"
> -                  "This step might take a long time on a large file.\n"
> -                  "What do you want to do?" ),
> -                  _( "Build index then play" ), _( "Play as is" ), _( "Do not play") ) )
> +            if( i_do_index == 0 )
>              {
> -                case 1:
> -                    b_index = true;
> -                    msg_Dbg( p_demux, "Fixing AVI index" );
> -                    goto aviindex;
> -                case 3:
> -                    /* Kill input */
> -                    vlc_object_kill( p_demux->p_parent );
> -                    goto error;
> +                switch( dialog_Question( p_demux, _("Broken or missing AVI Index") ,
> +                   _( "Because this AVI file index is broken or missing, "
> +                      "seeking will not work correctly.\n"
> +                      "VLC won't repair your file but can temporary fix this "
> +                      "problem by building an index in memory.\n"
> +                      "This step might take a long time on a large file.\n"
> +                      "What do you want to do?" ),
> +                      _( "Build index then play" ), _( "Play as is" ), _( "Do not play") ) )
> +                {
> +                    case 1:
> +                        b_index = true;
> +                        msg_Dbg( p_demux, "Fixing AVI index" );
> +                        goto aviindex;
> +                    case 3:
> +                        /* Kill input */
> +                        vlc_object_kill( p_demux->p_parent );
> +                        goto error;
> +                }
> +            }
> +            else
> +            {
> +                b_index = true;
> +                msg_Dbg( p_demux, "Fixing AVI index" );
> +                goto aviindex;
>              }
>          }
>      }




More information about the vlc-devel mailing list