Skip to content

Commit

Permalink
demux: libmp4: constify counters/walkers
Browse files Browse the repository at this point in the history
  • Loading branch information
fcartegnie committed Jun 13, 2015
1 parent 455153a commit 30c09ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions modules/demux/mp4/libmp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -4155,10 +4155,10 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
}


static void MP4_BoxDumpStructure_Internal( stream_t *s,
MP4_Box_t *p_box, unsigned int i_level )
static void MP4_BoxDumpStructure_Internal( stream_t *s, const MP4_Box_t *p_box,
unsigned int i_level )
{
MP4_Box_t *p_child;
const MP4_Box_t *p_child;
uint32_t i_displayedtype = p_box->i_type;
if( ! MP4_BOX_TYPE_ASCII() ) ((char*)&i_displayedtype)[0] = 'c';

Expand Down Expand Up @@ -4194,7 +4194,7 @@ static void MP4_BoxDumpStructure_Internal( stream_t *s,
}
}

void MP4_BoxDumpStructure( stream_t *s, MP4_Box_t *p_box )
void MP4_BoxDumpStructure( stream_t *s, const MP4_Box_t *p_box )
{
MP4_BoxDumpStructure_Internal( s, p_box, 0 );
}
Expand Down Expand Up @@ -4250,8 +4250,8 @@ static void get_token( char **ppsz_path, char **ppsz_token, int *pi_number )
}
}

static void MP4_BoxGet_Internal( MP4_Box_t **pp_result,
MP4_Box_t *p_box, const char *psz_fmt, va_list args)
static void MP4_BoxGet_Internal( const MP4_Box_t **pp_result, const MP4_Box_t *p_box,
const char *psz_fmt, va_list args)
{
char *psz_dup;
char *psz_path;
Expand Down Expand Up @@ -4384,16 +4384,16 @@ static void MP4_BoxGet_Internal( MP4_Box_t **pp_result,
* ex: /moov/trak[12]
* ../mdia
*****************************************************************************/
MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... )
MP4_Box_t *MP4_BoxGet( const MP4_Box_t *p_box, const char *psz_fmt, ... )
{
va_list args;
MP4_Box_t *p_result;
const MP4_Box_t *p_result;

va_start( args, psz_fmt );
MP4_BoxGet_Internal( &p_result, p_box, psz_fmt, args );
va_end( args );

return( p_result );
return( (MP4_Box_t *) p_result );
}

/*****************************************************************************
Expand All @@ -4405,11 +4405,11 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... )
* ex: /moov/trak[12]
* ../mdia
*****************************************************************************/
unsigned MP4_BoxCount( MP4_Box_t *p_box, const char *psz_fmt, ... )
unsigned MP4_BoxCount( const MP4_Box_t *p_box, const char *psz_fmt, ... )
{
va_list args;
unsigned i_count;
MP4_Box_t *p_result, *p_next;
const MP4_Box_t *p_result, *p_next;

va_start( args, psz_fmt );
MP4_BoxGet_Internal( &p_result, p_box, psz_fmt, args );
Expand Down
6 changes: 3 additions & 3 deletions modules/demux/mp4/libmp4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ void MP4_BoxFree( stream_t *, MP4_Box_t *p_box );
*****************************************************************************
* Useful while debugging
*****************************************************************************/
void MP4_BoxDumpStructure( stream_t *p_input, MP4_Box_t *p_box );
void MP4_BoxDumpStructure( stream_t *p_input, const MP4_Box_t *p_box );

/*****************************************************************************
* MP4_BoxGet: find a box given a path relative to p_box
Expand All @@ -1685,7 +1685,7 @@ void MP4_BoxDumpStructure( stream_t *p_input, MP4_Box_t *p_box );
* ex: /moov/trak[12]
* ../mdia
*****************************************************************************/
MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... );
MP4_Box_t *MP4_BoxGet( const MP4_Box_t *p_box, const char *psz_fmt, ... );

/*****************************************************************************
* MP4_BoxCount: find number of box given a path relative to p_box
Expand All @@ -1696,7 +1696,7 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... );
* ex: /moov/trak
* ../mdia
*****************************************************************************/
unsigned MP4_BoxCount( MP4_Box_t *p_box, const char *psz_fmt, ... );
unsigned MP4_BoxCount( const MP4_Box_t *p_box, const char *psz_fmt, ... );

/* Internal functions exposed for MKV demux */
int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t *p_box );
Expand Down

0 comments on commit 30c09ef

Please sign in to comment.