#include <vlc_plugin.h>
#include <vlc_demux.h>
-#include <vlc_interface.h>
+#include <vlc_dialog.h>
#include <vlc_meta.h>
#include <vlc_codecs.h>
set_subcategory( SUBCAT_INPUT_DEMUX )
add_bool( "avi-interleaved", 0, NULL,
- INTERLEAVE_TEXT, INTERLEAVE_LONGTEXT, true );
+ INTERLEAVE_TEXT, INTERLEAVE_LONGTEXT, true )
add_integer( "avi-index", 0, NULL,
- INDEX_TEXT, INDEX_LONGTEXT, false );
- change_integer_list( pi_index, ppsz_indexes, NULL );
+ INDEX_TEXT, INDEX_LONGTEXT, false )
+ change_integer_list( pi_index, ppsz_indexes, NULL )
set_callbacks( Open, Close )
vlc_module_end ()
if( ( p_sys->meta = vlc_meta_New() ) )
{
char buffer[200];
- sprintf( buffer, "%s%s%s%s",
- p_avih->i_flags&AVIF_HASINDEX?" HAS_INDEX":"",
- p_avih->i_flags&AVIF_MUSTUSEINDEX?" MUST_USE_INDEX":"",
- p_avih->i_flags&AVIF_ISINTERLEAVED?" IS_INTERLEAVED":"",
- p_avih->i_flags&AVIF_TRUSTCKTYPE?" TRUST_CKTYPE":"" );
+ snprintf( buffer, sizeof(buffer), "%s%s%s%s",
+ p_avih->i_flags&AVIF_HASINDEX?" HAS_INDEX":"",
+ p_avih->i_flags&AVIF_MUSTUSEINDEX?" MUST_USE_INDEX":"",
+ p_avih->i_flags&AVIF_ISINTERLEAVED?" IS_INTERLEAVED":"",
+ p_avih->i_flags&AVIF_TRUSTCKTYPE?" TRUST_CKTYPE":"" );
vlc_meta_SetSetting( p_sys->meta, buffer );
}
{
const uint8_t *p_pal = fmt.p_extra;
- fmt.video.p_palette = calloc( sizeof(video_palette_t), 1 );
+ fmt.video.p_palette = calloc( 1, sizeof(video_palette_t) );
fmt.video.p_palette->i_entries = __MIN(fmt.i_extra/4, 256);
for( int i = 0; i < fmt.video.p_palette->i_entries; i++ )
continue;
}
if( p_strn )
- {
- /* The charset of p_strn is undefined */
- EnsureUTF8( p_strn->p_str );
- fmt.psz_description = strdup( p_strn->p_str );
- }
+ fmt.psz_description = FromLatin1( p_strn->p_str );
if( tk->p_out_muxed == NULL )
tk->p_es = es_out_Add( p_demux->out, &fmt );
TAB_APPEND( p_sys->i_track, p_sys->track, tk );
b_index = true;
goto aviindex;
}
- int i_create;
- i_create = intf_UserYesNo( p_demux, _("AVI Index") ,
- _( "This AVI file is broken. Seeking will not "
- "work correctly.\nDo you want to "
- "try to repair it?\n\nThis might take a long time." ),
- _( "Repair" ), _( "Don't repair" ), _( "Cancel") );
- if( i_create == DIALOG_OK_YES )
- {
- b_index = true;
- msg_Dbg( p_demux, "Fixing AVI index" );
- goto aviindex;
- }
- else if( i_create == DIALOG_CANCELLED )
+ switch( dialog_Question( p_demux, _("AVI Index") ,
+ _( "This AVI file is broken. Seeking will not work correctly.\n"
+ "Do you want to try to fix it?\n\n"
+ "This might take a long time." ),
+ _( "Repair" ), _( "Don't repair" ), _( "Cancel") ) )
{
- /* Kill input */
- vlc_object_kill( p_demux->p_parent );
- goto error;
+ 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;
}
}
}
break;
case AVITWOCC_dc:
case AVITWOCC_db:
+ case AVITWOCC_AC:
SET_PTR( pi_type, VIDEO_ES );
break;
default:
off_t i_movi_end;
mtime_t i_dialog_update;
- int i_dialog_id;
+ dialog_progress_bar_t *p_dialog = NULL;
p_riff = AVI_ChunkFind( &p_sys->ck_root, AVIFOURCC_RIFF, 0);
p_movi = AVI_ChunkFind( p_riff, AVIFOURCC_movi, 0);
/* Only show dialog if AVI is > 10MB */
- i_dialog_id = -1;
i_dialog_update = mdate();
if( stream_Size( p_demux->s ) > 10000000 )
- i_dialog_id = intf_IntfProgress( p_demux, _("Fixing AVI Index..."), 0.0 );
+ p_dialog = dialog_ProgressCreate( p_demux, NULL,
+ _("Fixing AVI Index..."), _("Cancel") );
for( ;; )
{
break;
/* Don't update/check dialog too often */
- if( i_dialog_id > 0 && mdate() - i_dialog_update > 100000 )
+ if( p_dialog && mdate() - i_dialog_update > 100000 )
{
- if( intf_ProgressIsCancelled( p_demux, i_dialog_id ) )
+ if( dialog_ProgressCancelled( p_dialog ) )
break;
- double f_pos = 100.0 * stream_Tell( p_demux->s ) /
- stream_Size( p_demux->s );
- intf_ProgressUpdate( p_demux, i_dialog_id,
- _( "Fixing AVI Index..." ), f_pos, -1 );
+ float f_pos = (float)stream_Tell( p_demux->s ) /
+ (float)stream_Size( p_demux->s );
+ dialog_ProgressSet( p_dialog, NULL, f_pos );
i_dialog_update = mdate();
}
}
print_stat:
- if( i_dialog_id > 0 )
- intf_UserHide( p_demux, i_dialog_id );
+ if( p_dialog != NULL )
+ dialog_ProgressDestroy( p_dialog );
for( i_stream = 0; i_stream < p_sys->i_track; i_stream++ )
{