[vlc-commits] demux: mp4: use VLC_DEMUXER_
Francois Cartegnie
git at videolan.org
Tue Mar 29 19:58:50 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Mar 25 16:20:02 2016 +0100| [4b3ed727d16d1c9b6dbef3979cf2ea9a2bedb6d0] | committer: Francois Cartegnie
demux: mp4: use VLC_DEMUXER_
already confusing enough
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4b3ed727d16d1c9b6dbef3979cf2ea9a2bedb6d0
---
modules/demux/mp4/mp4.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 762dfa0..7c65c66 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -915,12 +915,12 @@ static int Demux( demux_t *p_demux )
(mtime_t)p_sys->i_overall_duration /
(mtime_t)p_sys->i_timescale;
if( MP4_GetMoviePTS( p_sys ) >= i_length )
- return 0;
- return 1;
+ return VLC_DEMUXER_EOF;
+ return VLC_DEMUXER_SUCCESS;
}
msg_Warn( p_demux, "no track selected, exiting..." );
- return 0;
+ return VLC_DEMUXER_EOF;
}
/* */
@@ -1060,7 +1060,7 @@ end:
}
}
- return b_data_sent || ( i_samplessize == 0 && i_nb_samples );
+ return (b_data_sent || ( i_samplessize == 0 && i_nb_samples )) ? VLC_DEMUXER_SUCCESS : VLC_DEMUXER_EOF;
}
static void MP4_UpdateSeekpoint( demux_t *p_demux )
@@ -3692,7 +3692,7 @@ static int MP4_frg_TrackSelect( demux_t *p_demux, mp4_track_t *p_track )
/**
* DemuxFrg: read packet and send them to decoders
- * \return 1 on success, 0 on error.
+ * \return VLC_DEMUXER_SUCCESS on success, VLC_DEMUXER_EOF on error.
* TODO check for newly selected track
*/
int DemuxFrg( demux_t *p_demux )
@@ -3736,12 +3736,12 @@ int DemuxFrg( demux_t *p_demux )
(mtime_t)p_sys->i_overall_duration /
(mtime_t)p_sys->i_timescale;
if( MP4_GetMoviePTS( p_sys ) >= i_length )
- return 0;
- return 1;
+ return VLC_DEMUXER_EOF;
+ return VLC_DEMUXER_SUCCESS;
}
msg_Warn( p_demux, "no track selected, exiting..." );
- return 0;
+ return VLC_DEMUXER_EOF;
}
/* first wait for the good time to read a packet */
@@ -3767,7 +3767,7 @@ int DemuxFrg( demux_t *p_demux )
if( MP4_frg_GetChunks( p_demux, tk->i_track_ID ) != VLC_SUCCESS )
{
msg_Info( p_demux, "MP4_frg_GetChunks returned error. End of stream?" );
- return 0;
+ return VLC_DEMUXER_EOF;
}
}
@@ -3781,7 +3781,7 @@ int DemuxFrg( demux_t *p_demux )
{
msg_Err( p_demux, "sample %"PRIu32" of %"PRIu32"",
ck->i_sample, ck->i_sample_count );
- return 0;
+ return VLC_DEMUXER_EOF;
}
uint32_t sample_size = ck->p_sample_size[ck->i_sample];
@@ -3811,7 +3811,7 @@ int DemuxFrg( demux_t *p_demux )
break;
}
}
- return 1;
+ return VLC_DEMUXER_SUCCESS;
}
static bool BoxExistsInRootTree( MP4_Box_t *p_root, uint32_t i_type, uint64_t i_pos )
@@ -4802,7 +4802,7 @@ static int DemuxAsLeaf( demux_t *p_demux )
if( i_track_selected <= 0 )
{
msg_Warn( p_demux, "no track selected, exiting..." );
- return 0;
+ return VLC_DEMUXER_EOF;
}
if ( p_sys->context.i_current_box_type != ATOM_mdat )
@@ -4811,7 +4811,7 @@ static int DemuxAsLeaf( demux_t *p_demux )
const uint8_t *p_peek;
int i_read = stream_Peek( p_demux->s, &p_peek, 8 );
if ( i_read < 8 )
- return 0;
+ return VLC_DEMUXER_EOF;
p_sys->context.i_current_box_type = VLC_FOURCC( p_peek[4], p_peek[5], p_peek[6], p_peek[7] );
@@ -4822,7 +4822,7 @@ static int DemuxAsLeaf( demux_t *p_demux )
{// only if !b_probed ??
MP4_Box_t *p_vroot = MP4_BoxGetNextChunk( p_demux->s );
if(!p_vroot)
- return 1;
+ return VLC_DEMUXER_SUCCESS;
MP4_Box_t *p_fragbox = MP4_BoxGet( p_vroot, "moof" );
if( !p_fragbox )
@@ -4835,7 +4835,7 @@ static int DemuxAsLeaf( demux_t *p_demux )
{
MP4_BoxFree( p_vroot );
msg_Info(p_demux, "no moof or moov in current chunk");
- return 1;
+ return VLC_DEMUXER_SUCCESS;
}
MP4_Box_t *p_mfhd = MP4_BoxGet( p_fragbox, "mfhd" );
@@ -4944,7 +4944,7 @@ static int DemuxAsLeaf( demux_t *p_demux )
p_sys->i_pcr = i_lowest_dts;
es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pcr );
- return 1;
+ return VLC_DEMUXER_SUCCESS;
}
/* ASF Handlers */
More information about the vlc-commits
mailing list