Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
197852f8
Commit
197852f8
authored
Aug 28, 2011
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MP4: code factorization and cleaning
parent
d896f8e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
45 deletions
+33
-45
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+27
-36
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+1
-1
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+5
-8
No files found.
modules/demux/mp4/libmp4.c
View file @
197852f8
...
...
@@ -2,7 +2,6 @@
* libmp4.c : LibMP4 library for mp4 module for vlc
*****************************************************************************
* Copyright (C) 2001-2004, 2010 the VideoLAN team
* $Id$
*
* Author: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -3095,10 +3094,10 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
CreateUUID
(
&
p_root
->
i_uuid
,
p_root
->
i_type
);
p_root
->
data
.
p_data
=
NULL
;
p_root
->
p_father
=
NULL
;
p_root
->
p_first
=
NULL
;
p_root
->
p_last
=
NULL
;
p_root
->
p_next
=
NULL
;
p_root
->
p_father
=
NULL
;
p_root
->
p_first
=
NULL
;
p_root
->
p_last
=
NULL
;
p_root
->
p_next
=
NULL
;
p_stream
=
s
;
...
...
@@ -3136,7 +3135,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
}
static
void
__MP4_BoxDumpStructure
(
stream_t
*
s
,
static
void
MP4_BoxDumpStructure_Internal
(
stream_t
*
s
,
MP4_Box_t
*
p_box
,
unsigned
int
i_level
)
{
MP4_Box_t
*
p_child
;
...
...
@@ -3176,18 +3175,17 @@ static void __MP4_BoxDumpStructure( stream_t *s,
p_child
=
p_box
->
p_first
;
while
(
p_child
)
{
__MP4_BoxDumpStructure
(
s
,
p_child
,
i_level
+
1
);
MP4_BoxDumpStructure_Internal
(
s
,
p_child
,
i_level
+
1
);
p_child
=
p_child
->
p_next
;
}
}
void
MP4_BoxDumpStructure
(
stream_t
*
s
,
MP4_Box_t
*
p_box
)
{
__MP4_BoxDumpStructure
(
s
,
p_box
,
0
);
MP4_BoxDumpStructure_Internal
(
s
,
p_box
,
0
);
}
/*****************************************************************************
*****************************************************************************
**
...
...
@@ -3195,7 +3193,7 @@ void MP4_BoxDumpStructure( stream_t *s, MP4_Box_t *p_box )
**
*****************************************************************************
*****************************************************************************/
static
void
__
get_token
(
char
**
ppsz_path
,
char
**
ppsz_token
,
int
*
pi_number
)
static
void
get_token
(
char
**
ppsz_path
,
char
**
ppsz_token
,
int
*
pi_number
)
{
size_t
i_len
;
if
(
!*
ppsz_path
[
0
]
)
...
...
@@ -3245,11 +3243,12 @@ static void __get_token( char **ppsz_path, char **ppsz_token, int *pi_number )
}
}
static
void
__MP4_BoxGet
(
MP4_Box_t
**
pp_result
,
static
void
MP4_BoxGet_Internal
(
MP4_Box_t
**
pp_result
,
MP4_Box_t
*
p_box
,
const
char
*
psz_fmt
,
va_list
args
)
{
char
*
psz_dup
;
char
*
psz_path
;
char
*
psz_token
;
if
(
!
p_box
)
{
...
...
@@ -3271,10 +3270,9 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
psz_dup
=
psz_path
;
/* keep this pointer, as it need to be unallocated */
for
(
;
;
)
{
char
*
psz_token
;
int
i_number
;
__
get_token
(
&
psz_path
,
&
psz_token
,
&
i_number
);
get_token
(
&
psz_path
,
&
psz_token
,
&
i_number
);
// fprintf( stderr, "path:'%s', token:'%s' n:%d\n",
// psz_path,psz_token,i_number );
if
(
!
psz_token
)
...
...
@@ -3293,10 +3291,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
}
if
(
!
p_box
)
{
free
(
psz_token
);
free
(
psz_dup
);
*
pp_result
=
NULL
;
return
;
goto
error_box
;
}
}
else
...
...
@@ -3310,10 +3305,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
p_box
=
p_box
->
p_father
;
if
(
!
p_box
)
{
free
(
psz_token
);
free
(
psz_dup
);
*
pp_result
=
NULL
;
return
;
goto
error_box
;
}
}
else
...
...
@@ -3327,10 +3319,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
{
if
(
!
p_box
)
{
free
(
psz_token
);
free
(
psz_dup
);
*
pp_result
=
NULL
;
return
;
goto
error_box
;
}
if
(
p_box
->
i_type
==
i_fourcc
)
{
...
...
@@ -3351,10 +3340,7 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
{
if
(
!
p_box
)
{
free
(
psz_token
);
free
(
psz_dup
);
*
pp_result
=
NULL
;
return
;
goto
error_box
;
}
if
(
!
i_number
)
{
...
...
@@ -3367,14 +3353,19 @@ static void __MP4_BoxGet( MP4_Box_t **pp_result,
else
{
// fprintf( stderr, "Argg malformed token \"%s\"",psz_token );
FREENULL
(
psz_token
);
free
(
psz_dup
);
*
pp_result
=
NULL
;
return
;
goto
error_box
;
}
free
(
psz_token
);
FREENULL
(
psz_token
);
}
return
;
error_box:
free
(
psz_token
);
free
(
psz_dup
);
*
pp_result
=
NULL
;
return
;
}
/*****************************************************************************
...
...
@@ -3392,7 +3383,7 @@ MP4_Box_t *MP4_BoxGet( MP4_Box_t *p_box, const char *psz_fmt, ... )
MP4_Box_t
*
p_result
;
va_start
(
args
,
psz_fmt
);
__MP4_BoxGet
(
&
p_result
,
p_box
,
psz_fmt
,
args
);
MP4_BoxGet_Internal
(
&
p_result
,
p_box
,
psz_fmt
,
args
);
va_end
(
args
);
return
(
p_result
);
...
...
@@ -3414,7 +3405,7 @@ int MP4_BoxCount( MP4_Box_t *p_box, const char *psz_fmt, ... )
MP4_Box_t
*
p_result
,
*
p_next
;
va_start
(
args
,
psz_fmt
);
__MP4_BoxGet
(
&
p_result
,
p_box
,
psz_fmt
,
args
);
MP4_BoxGet_Internal
(
&
p_result
,
p_box
,
psz_fmt
,
args
);
va_end
(
args
);
if
(
!
p_result
)
{
...
...
modules/demux/mp4/libmp4.h
View file @
197852f8
...
...
@@ -2,7 +2,7 @@
* libmp4.h : LibMP4 library for mp4 module for vlc
*****************************************************************************
* Copyright (C) 2001-2004, 2010 the VideoLAN team
*
$Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
...
...
modules/demux/mp4/mp4.c
View file @
197852f8
...
...
@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001-2004, 2010 the VideoLAN team
*
$Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -31,17 +31,14 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
#include <vlc_md5.h>
#include <vlc_charset.h>
#include <vlc_iso_lang.h>
#include <vlc_meta.h>
#include <vlc_charset.h>
/* EnsureUTF8 */
#include <vlc_meta.h>
/* vlc_meta_t, vlc_meta_ */
#include <vlc_input.h>
#include "libmp4.h"
#include "drms.h"
#include "id3genres.h"
#include "id3genres.h"
/* for FOURCC_gnre */
/*****************************************************************************
* Module descriptor
...
...
@@ -54,7 +51,7 @@ vlc_module_begin ()
set_subcategory
(
SUBCAT_INPUT_DEMUX
)
set_description
(
N_
(
"MP4 stream demuxer"
)
)
set_shortname
(
N_
(
"MP4"
)
)
set_capability
(
"demux"
,
24
2
)
set_capability
(
"demux"
,
24
0
)
set_callbacks
(
Open
,
Close
)
vlc_module_end
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment