Commit b9220e2d authored by Laurent Aimar's avatar Laurent Aimar

Cosmetics.

parent ec79cd93
...@@ -2381,13 +2381,9 @@ static void AVI_IndexCreate( demux_t *p_demux ) ...@@ -2381,13 +2381,9 @@ static void AVI_IndexCreate( demux_t *p_demux )
/* Only show dialog if AVI is > 10MB */ /* Only show dialog if AVI is > 10MB */
i_dialog_id = -1; i_dialog_id = -1;
i_dialog_update = mdate();
if( stream_Size( p_demux->s ) > 10000000 ) if( stream_Size( p_demux->s ) > 10000000 )
{ i_dialog_id = intf_IntfProgress( p_demux, _("Fixing AVI Index..."), 0.0 );
i_dialog_id = intf_IntfProgress( p_demux,
_( "Fixing AVI Index..." ),
0.0 );
i_dialog_update = mdate();
}
for( ;; ) for( ;; )
{ {
...@@ -2402,18 +2398,17 @@ static void AVI_IndexCreate( demux_t *p_demux ) ...@@ -2402,18 +2398,17 @@ static void AVI_IndexCreate( demux_t *p_demux )
if( intf_ProgressIsCancelled( p_demux, i_dialog_id ) ) if( intf_ProgressIsCancelled( p_demux, i_dialog_id ) )
break; break;
int64_t i_pos = stream_Tell( p_demux->s )* 100 / double f_pos = 100.0 * stream_Tell( p_demux->s ) /
stream_Size( p_demux->s ); stream_Size( p_demux->s );
float f_pos = (float)i_pos;
i_dialog_update = mdate();
intf_ProgressUpdate( p_demux, i_dialog_id, intf_ProgressUpdate( p_demux, i_dialog_id,
_( "Fixing AVI Index..." ), f_pos, -1 ); _( "Fixing AVI Index..." ), f_pos, -1 );
i_dialog_update = mdate();
} }
if( AVI_PacketGetHeader( p_demux, &pk ) ) if( AVI_PacketGetHeader( p_demux, &pk ) )
{
break; break;
}
if( pk.i_stream < p_sys->i_track && if( pk.i_stream < p_sys->i_track &&
pk.i_cat == p_sys->track[pk.i_stream]->i_cat ) pk.i_cat == p_sys->track[pk.i_stream]->i_cat )
{ {
...@@ -2429,33 +2424,35 @@ static void AVI_IndexCreate( demux_t *p_demux ) ...@@ -2429,33 +2424,35 @@ static void AVI_IndexCreate( demux_t *p_demux )
{ {
switch( pk.i_fourcc ) switch( pk.i_fourcc )
{ {
case AVIFOURCC_idx1: case AVIFOURCC_idx1:
if( p_sys->b_odml ) if( p_sys->b_odml )
{ {
avi_chunk_list_t *p_sysx; avi_chunk_list_t *p_sysx;
p_sysx = AVI_ChunkFind( &p_sys->ck_root, p_sysx = AVI_ChunkFind( &p_sys->ck_root,
AVIFOURCC_RIFF, 1 ); AVIFOURCC_RIFF, 1 );
msg_Dbg( p_demux, "looking for new RIFF chunk" ); msg_Dbg( p_demux, "looking for new RIFF chunk" );
if( stream_Seek( p_demux->s, p_sysx->i_chunk_pos + 24)) if( stream_Seek( p_demux->s, p_sysx->i_chunk_pos + 24 ) )
{
goto print_stat;
}
break;
}
goto print_stat;
case AVIFOURCC_RIFF:
msg_Dbg( p_demux, "new RIFF chunk found" );
case AVIFOURCC_rec:
case AVIFOURCC_JUNK:
break;
default:
msg_Warn( p_demux, "need resync, probably broken avi" );
if( AVI_PacketSearch( p_demux ) )
{
msg_Warn( p_demux, "lost sync, abord index creation" );
goto print_stat; goto print_stat;
} break;
}
goto print_stat;
case AVIFOURCC_RIFF:
msg_Dbg( p_demux, "new RIFF chunk found" );
break;
case AVIFOURCC_rec:
case AVIFOURCC_JUNK:
break;
default:
msg_Warn( p_demux, "need resync, probably broken avi" );
if( AVI_PacketSearch( p_demux ) )
{
msg_Warn( p_demux, "lost sync, abord index creation" );
goto print_stat;
}
} }
} }
...@@ -2468,16 +2465,12 @@ static void AVI_IndexCreate( demux_t *p_demux ) ...@@ -2468,16 +2465,12 @@ static void AVI_IndexCreate( demux_t *p_demux )
print_stat: print_stat:
if( i_dialog_id > 0 ) if( i_dialog_id > 0 )
{
intf_UserHide( p_demux, i_dialog_id ); intf_UserHide( p_demux, i_dialog_id );
}
for( i_stream = 0; i_stream < p_sys->i_track; i_stream++ ) for( i_stream = 0; i_stream < p_sys->i_track; i_stream++ )
{ {
msg_Dbg( p_demux, msg_Dbg( p_demux, "stream[%d] creating %d index entries",
"stream[%d] creating %d index entries", i_stream, p_sys->track[i_stream]->i_idxnb );
i_stream,
p_sys->track[i_stream]->i_idxnb );
} }
} }
......
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