Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
ae78856f
Commit
ae78856f
authored
Jun 13, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: add some const to box refs
parent
b79c2d50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
42 deletions
+19
-42
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+10
-33
modules/demux/mp4/mp4.h
modules/demux/mp4/mp4.h
+9
-9
No files found.
modules/demux/mp4/mp4.c
View file @
ae78856f
...
@@ -2631,17 +2631,6 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2631,17 +2631,6 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
p_track
=
p_box_trak
;
p_track
->
p_track
=
p_box_trak
;
MP4_Box_t
*
p_tkhd
=
MP4_BoxGet
(
p_box_trak
,
"tkhd"
);
MP4_Box_t
*
p_tref
=
MP4_BoxGet
(
p_box_trak
,
"tref"
);
MP4_Box_t
*
p_elst
;
MP4_Box_t
*
p_mdhd
;
MP4_Box_t
*
p_udta
;
MP4_Box_t
*
p_hdlr
;
MP4_Box_t
*
p_vmhd
;
MP4_Box_t
*
p_smhd
;
char
language
[
4
]
=
{
'\0'
};
char
language
[
4
]
=
{
'\0'
};
/* hint track unsupported */
/* hint track unsupported */
...
@@ -2655,6 +2644,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2655,6 +2644,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
es_format_Init
(
&
p_track
->
fmt
,
UNKNOWN_ES
,
0
);
es_format_Init
(
&
p_track
->
fmt
,
UNKNOWN_ES
,
0
);
const
MP4_Box_t
*
p_tkhd
=
MP4_BoxGet
(
p_box_trak
,
"tkhd"
);
if
(
!
p_tkhd
)
if
(
!
p_tkhd
)
{
{
return
;
return
;
...
@@ -2672,13 +2662,10 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2672,13 +2662,10 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
i_height
=
BOXDATA
(
p_tkhd
)
->
i_height
/
BLOCK16x16
;
p_track
->
i_height
=
BOXDATA
(
p_tkhd
)
->
i_height
/
BLOCK16x16
;
p_track
->
f_rotation
=
BOXDATA
(
p_tkhd
)
->
f_rotation
;
p_track
->
f_rotation
=
BOXDATA
(
p_tkhd
)
->
f_rotation
;
if
(
p_tref
)
/* FIXME: unhandled box: tref */
{
/* msg_Warn( p_demux, "unhandled box: tref --> FIXME" ); */
}
p_mdhd
=
MP4_BoxGet
(
p_box_trak
,
"mdia/mdhd"
);
const
MP4_Box_t
*
p_mdhd
=
MP4_BoxGet
(
p_box_trak
,
"mdia/mdhd"
);
p_hdlr
=
MP4_BoxGet
(
p_box_trak
,
"mdia/hdlr"
);
const
MP4_Box_t
*
p_hdlr
=
MP4_BoxGet
(
p_box_trak
,
"mdia/hdlr"
);
if
(
(
!
p_mdhd
)
||
(
!
p_hdlr
)
)
if
(
(
!
p_mdhd
)
||
(
!
p_hdlr
)
)
{
{
...
@@ -2695,7 +2682,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2695,7 +2682,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
switch
(
p_hdlr
->
data
.
p_hdlr
->
i_handler_type
)
switch
(
p_hdlr
->
data
.
p_hdlr
->
i_handler_type
)
{
{
case
(
ATOM_soun
):
case
(
ATOM_soun
):
if
(
!
(
p_smhd
=
MP4_BoxGet
(
p_box_trak
,
"mdia/minf/smhd"
)
)
)
if
(
!
MP4_BoxGet
(
p_box_trak
,
"mdia/minf/smhd"
)
)
{
{
return
;
return
;
}
}
...
@@ -2703,7 +2690,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2703,7 +2690,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
break
;
break
;
case
(
ATOM_vide
):
case
(
ATOM_vide
):
if
(
!
(
p_vmhd
=
MP4_BoxGet
(
p_box_trak
,
"mdia/minf/vmhd"
)
)
)
if
(
!
MP4_BoxGet
(
p_box_trak
,
"mdia/minf/vmhd"
)
)
{
{
return
;
return
;
}
}
...
@@ -2726,6 +2713,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2726,6 +2713,7 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
return
;
return
;
}
}
const
MP4_Box_t
*
p_elst
;
p_track
->
i_elst
=
0
;
p_track
->
i_elst
=
0
;
p_track
->
i_elst_time
=
0
;
p_track
->
i_elst_time
=
0
;
if
(
(
p_track
->
p_elst
=
p_elst
=
MP4_BoxGet
(
p_box_trak
,
"edts/elst"
)
)
)
if
(
(
p_track
->
p_elst
=
p_elst
=
MP4_BoxGet
(
p_box_trak
,
"edts/elst"
)
)
)
...
@@ -2764,10 +2752,10 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2764,10 +2752,10 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
fmt
.
psz_language
=
strdup
(
language
);
p_track
->
fmt
.
psz_language
=
strdup
(
language
);
}
}
p_udta
=
MP4_BoxGet
(
p_box_trak
,
"udta"
);
const
MP4_Box_t
*
p_udta
=
MP4_BoxGet
(
p_box_trak
,
"udta"
);
if
(
p_udta
)
if
(
p_udta
)
{
{
MP4_Box_t
*
p_box_iter
;
const
MP4_Box_t
*
p_box_iter
;
for
(
p_box_iter
=
p_udta
->
p_first
;
p_box_iter
!=
NULL
;
for
(
p_box_iter
=
p_udta
->
p_first
;
p_box_iter
!=
NULL
;
p_box_iter
=
p_box_iter
->
p_next
)
p_box_iter
=
p_box_iter
->
p_next
)
{
{
...
@@ -2871,19 +2859,8 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -2871,19 +2859,8 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
i_track_ID
);
p_track
->
i_track_ID
);
return
;
return
;
}
}
p_track
->
b_ok
=
true
;
#if 0
{
int i;
for( i = 0; i < p_track->i_chunk_count; i++ )
{
fprintf( stderr, "%-5d sample_count=%d pts=%lld\n",
i, p_track->chunk[i].i_sample_count,
p_track->chunk[i].i_first_dts );
}
p_track
->
b_ok
=
p_track
->
b_chapter
||
!!
p_track
->
p_es
;
}
#endif
}
}
static
void
FreeAndResetChunk
(
mp4_chunk_t
*
ck
)
static
void
FreeAndResetChunk
(
mp4_chunk_t
*
ck
)
...
...
modules/demux/mp4/mp4.h
View file @
ae78856f
...
@@ -94,7 +94,7 @@ typedef struct
...
@@ -94,7 +94,7 @@ typedef struct
/* elst */
/* elst */
int
i_elst
;
/* current elst */
int
i_elst
;
/* current elst */
int64_t
i_elst_time
;
/* current elst start time (in movie time scale)*/
int64_t
i_elst_time
;
/* current elst start time (in movie time scale)*/
MP4_Box_t
*
p_elst
;
/* elst (could be NULL) */
const
MP4_Box_t
*
p_elst
;
/* elst (could be NULL) */
/* give the next sample to read, i_chunk is to find quickly where
/* give the next sample to read, i_chunk is to find quickly where
the sample is located */
the sample is located */
...
@@ -118,10 +118,10 @@ typedef struct
...
@@ -118,10 +118,10 @@ typedef struct
uint64_t
i_first_dts
;
/* i_first_dts value
uint64_t
i_first_dts
;
/* i_first_dts value
of the next chunk */
of the next chunk */
MP4_Box_t
*
p_track
;
const
MP4_Box_t
*
p_track
;
MP4_Box_t
*
p_stbl
;
/* will contain all timing information */
const
MP4_Box_t
*
p_stbl
;
/* will contain all timing information */
MP4_Box_t
*
p_stsd
;
/* will contain all data to initialize decoder */
const
MP4_Box_t
*
p_stsd
;
/* will contain all data to initialize decoder */
MP4_Box_t
*
p_sample
;
/* point on actual sdsd */
const
MP4_Box_t
*
p_sample
;
/* point on actual sdsd */
bool
b_has_non_empty_cchunk
;
bool
b_has_non_empty_cchunk
;
bool
b_codec_need_restart
;
bool
b_codec_need_restart
;
...
@@ -131,14 +131,14 @@ typedef struct
...
@@ -131,14 +131,14 @@ typedef struct
struct
struct
{
{
/* for moof parsing */
/* for moof parsing */
MP4_Box_t
*
p_traf
;
const
MP4_Box_t
*
p_traf
;
MP4_Box_t
*
p_tfhd
;
const
MP4_Box_t
*
p_tfhd
;
MP4_Box_t
*
p_trun
;
const
MP4_Box_t
*
p_trun
;
uint64_t
i_traf_base_offset
;
uint64_t
i_traf_base_offset
;
}
context
;
}
context
;
/* ASF packets handling */
/* ASF packets handling */
MP4_Box_t
*
p_asf
;
const
MP4_Box_t
*
p_asf
;
mtime_t
i_dts_backup
;
mtime_t
i_dts_backup
;
mtime_t
i_pts_backup
;
mtime_t
i_pts_backup
;
asf_track_info_t
asfinfo
;
asf_track_info_t
asfinfo
;
...
...
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