Commit 5a3410ab authored by François Cartegnie's avatar François Cartegnie 🤞

demux: avi: use VLC_DEMUX_

parent 6beabe2c
...@@ -1007,11 +1007,11 @@ static int Demux_Seekable( demux_t *p_demux ) ...@@ -1007,11 +1007,11 @@ static int Demux_Seekable( demux_t *p_demux )
if( i_length > 0 ) if( i_length > 0 )
{ {
if( p_sys->i_time >= i_length ) if( p_sys->i_time >= i_length )
return 0; return VLC_DEMUXER_EOF;
return 1; return VLC_DEMUXER_SUCCESS;
} }
msg_Warn( p_demux, "no track selected, exiting..." ); msg_Warn( p_demux, "no track selected, exiting..." );
return 0; return VLC_DEMUXER_EOF;
} }
/* wait for the good time */ /* wait for the good time */
...@@ -1089,10 +1089,10 @@ static int Demux_Seekable( demux_t *p_demux ) ...@@ -1089,10 +1089,10 @@ static int Demux_Seekable( demux_t *p_demux )
for( i = 0; i < p_sys->i_track; i++ ) for( i = 0; i < p_sys->i_track; i++ )
{ {
if( toread[i].b_ok ) if( toread[i].b_ok )
return 1; return VLC_DEMUXER_SUCCESS;
} }
msg_Warn( p_demux, "all tracks have failed, exiting..." ); msg_Warn( p_demux, "all tracks have failed, exiting..." );
return 0; return VLC_DEMUXER_EOF;
} }
if( i_pos == -1 ) if( i_pos == -1 )
...@@ -1354,7 +1354,7 @@ static int Demux_UnSeekable( demux_t *p_demux ) ...@@ -1354,7 +1354,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
else else
{ {
msg_Warn( p_demux, "no more stream selected" ); msg_Warn( p_demux, "no more stream selected" );
return( 0 ); return VLC_DEMUXER_EOF;
} }
} }
...@@ -1368,7 +1368,7 @@ static int Demux_UnSeekable( demux_t *p_demux ) ...@@ -1368,7 +1368,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
if( AVI_PacketGetHeader( p_demux, &avi_pk ) ) if( AVI_PacketGetHeader( p_demux, &avi_pk ) )
{ {
return( 0 ); return VLC_DEMUXER_EOF;
} }
if( avi_pk.i_stream >= p_sys->i_track || if( avi_pk.i_stream >= p_sys->i_track ||
...@@ -1389,14 +1389,14 @@ static int Demux_UnSeekable( demux_t *p_demux ) ...@@ -1389,14 +1389,14 @@ static int Demux_UnSeekable( demux_t *p_demux )
{ {
return( !AVI_PacketNext( p_demux ) ? 1 : 0 ); return( !AVI_PacketNext( p_demux ) ? 1 : 0 );
} }
return( 0 ); /* eof */ return VLC_DEMUXER_EOF;
default: default:
msg_Warn( p_demux, msg_Warn( p_demux,
"seems to have lost position @%ld, resync", stream_Tell(p_demux->s) ); "seems to have lost position @%ld, resync", stream_Tell(p_demux->s) );
if( AVI_PacketSearch( p_demux ) ) if( AVI_PacketSearch( p_demux ) )
{ {
msg_Err( p_demux, "resync failed" ); msg_Err( p_demux, "resync failed" );
return( -1 ); return VLC_DEMUXER_EGENERIC;
} }
} }
} }
...@@ -1411,7 +1411,7 @@ static int Demux_UnSeekable( demux_t *p_demux ) ...@@ -1411,7 +1411,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
block_t *p_frame = ReadFrame( p_demux, p_stream, 8, avi_pk.i_size + 8 ) ; block_t *p_frame = ReadFrame( p_demux, p_stream, 8, avi_pk.i_size + 8 ) ;
if( p_frame == NULL ) if( p_frame == NULL )
{ {
return( -1 ); return VLC_DEMUXER_EGENERIC;
} }
p_frame->i_pts = VLC_TS_0 + AVI_GetPTS( p_stream ); p_frame->i_pts = VLC_TS_0 + AVI_GetPTS( p_stream );
...@@ -1431,7 +1431,7 @@ static int Demux_UnSeekable( demux_t *p_demux ) ...@@ -1431,7 +1431,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
{ {
if( AVI_PacketNext( p_demux ) ) if( AVI_PacketNext( p_demux ) )
{ {
return( 0 ); return VLC_DEMUXER_EOF;
} }
} }
...@@ -1453,7 +1453,7 @@ static int Demux_UnSeekable( demux_t *p_demux ) ...@@ -1453,7 +1453,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
#undef p_stream #undef p_stream
} }
return( 1 ); return VLC_DEMUXER_SUCCESS;
} }
/***************************************************************************** /*****************************************************************************
......
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