Commit cedc46ea authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

AVI: add an automatic decision choice for AVI index

Propose a choice to automatically rebuild the index when broken...
parent c901035a
...@@ -59,11 +59,12 @@ ...@@ -59,11 +59,12 @@
static int Open ( vlc_object_t * ); static int Open ( vlc_object_t * );
static void Close( vlc_object_t * ); static void Close( vlc_object_t * );
static const int pi_index[] = {0,1,2}; static const int pi_index[] = {0,1,2,3};
static const char *const ppsz_indexes[] = { N_("Ask for action"), static const char *const ppsz_indexes[] = { N_("Ask for action"),
N_("Always fix"), N_("Always fix"),
N_("Never fix") }; N_("Never fix"),
N_("Fix when necessary")};
vlc_module_begin () vlc_module_begin ()
set_shortname( "AVI" ) set_shortname( "AVI" )
...@@ -666,12 +667,14 @@ aviindex: ...@@ -666,12 +667,14 @@ aviindex:
msg_Warn( p_demux, "broken or missing index, 'seek' will be " msg_Warn( p_demux, "broken or missing index, 'seek' will be "
"approximative or will exhibit strange behavior" ); "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 ) { if( !p_sys->b_seekable ) {
b_index = true; b_index = true;
goto aviindex; goto aviindex;
} }
if( i_do_index == 0 )
{
switch( dialog_Question( p_demux, _("Broken or missing AVI Index") , switch( dialog_Question( p_demux, _("Broken or missing AVI Index") ,
_( "Because this AVI file index is broken or missing, " _( "Because this AVI file index is broken or missing, "
"seeking will not work correctly.\n" "seeking will not work correctly.\n"
...@@ -691,6 +694,13 @@ aviindex: ...@@ -691,6 +694,13 @@ aviindex:
goto error; goto error;
} }
} }
else
{
b_index = true;
msg_Dbg( p_demux, "Fixing AVI index" );
goto aviindex;
}
}
} }
/* fix some BeOS MediaKit generated file */ /* fix some BeOS MediaKit generated file */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment