Commit 178e6d95 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: libmp4: expose MP4_seek

parent 545f5b8a
......@@ -77,7 +77,7 @@ static int MP4_Box_Read_Specific( stream_t *p_stream, MP4_Box_t *p_box, MP4_Box_
static void MP4_Box_Clean_Specific( MP4_Box_t *p_box );
static int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t *p_box );
static int MP4_Seek( stream_t *p_stream, uint64_t i_pos )
int MP4_Seek( stream_t *p_stream, uint64_t i_pos )
{
/* Prevent prefetch breakage */
uint64_t i_size = stream_Size( p_stream );
......@@ -102,9 +102,10 @@ static int MP4_Seek( stream_t *p_stream, uint64_t i_pos )
return VLC_SUCCESS;
else if( i_toread > (1<<17) )
return VLC_EGENERIC;
else
return vlc_stream_Read( p_stream, NULL,
i_toread ) != (ssize_t)i_toread;
if( vlc_stream_Read( p_stream, NULL, i_toread ) != (ssize_t)i_toread )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
static void MP4_BoxAddChild( MP4_Box_t *p_parent, MP4_Box_t *p_childbox )
......
......@@ -1868,6 +1868,11 @@ static const UUID_t XML360BoxUUID = {
{ 0xff, 0xcc, 0x82, 0x63, 0xf8, 0x55, 0x4a, 0x93,
0x88, 0x14, 0x58, 0x7a, 0x02, 0x52, 0x1f, 0xdd } };
/*****************************************************************************
* MP4_Seek : non seekable stream safe seek
****************************************************************************/
int MP4_Seek( stream_t *p_stream, uint64_t i_pos );
/*****************************************************************************
* MP4_BoxGetNextChunk : Parse the entire moof box.
*****************************************************************************
......
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