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
3c5ab022
Commit
3c5ab022
authored
Apr 09, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp4: reindent and regroup
parent
9ad094db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
77 deletions
+77
-77
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+77
-77
No files found.
modules/demux/mp4/mp4.c
View file @
3c5ab022
...
@@ -1528,10 +1528,62 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -1528,10 +1528,62 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
p_pasp
=
MP4_BoxGet
(
p_sample
,
"pasp"
);
p_pasp
=
MP4_BoxGet
(
p_sample
,
"pasp"
);
if
(
p_track
->
fmt
.
i_cat
==
AUDIO_ES
&&
(
p_track
->
i_sample_size
==
1
||
p_track
->
i_sample_size
==
2
)
)
/* */
switch
(
p_track
->
fmt
.
i_cat
)
{
{
MP4_Box_data_sample_soun_t
*
p_soun
;
case
VIDEO_ES
:
p_track
->
fmt
.
video
.
i_width
=
p_sample
->
data
.
p_sample_vide
->
i_width
;
p_track
->
fmt
.
video
.
i_height
=
p_sample
->
data
.
p_sample_vide
->
i_height
;
p_track
->
fmt
.
video
.
i_bits_per_pixel
=
p_sample
->
data
.
p_sample_vide
->
i_depth
;
/* fall on display size */
if
(
p_track
->
fmt
.
video
.
i_width
<=
0
)
p_track
->
fmt
.
video
.
i_width
=
p_track
->
i_width
;
if
(
p_track
->
fmt
.
video
.
i_height
<=
0
)
p_track
->
fmt
.
video
.
i_height
=
p_track
->
i_height
;
/* Find out apect ratio from display size */
if
(
p_track
->
i_width
>
0
&&
p_track
->
i_height
>
0
&&
/* Work-around buggy muxed files */
p_sample
->
data
.
p_sample_vide
->
i_width
!=
p_track
->
i_width
)
{
p_track
->
fmt
.
video
.
i_sar_num
=
p_track
->
i_width
*
p_track
->
fmt
.
video
.
i_height
;
p_track
->
fmt
.
video
.
i_sar_den
=
p_track
->
i_height
*
p_track
->
fmt
.
video
.
i_width
;
}
if
(
p_pasp
&&
p_pasp
->
data
.
p_pasp
->
i_horizontal_spacing
>
0
&&
p_pasp
->
data
.
p_pasp
->
i_vertical_spacing
>
0
)
{
p_track
->
fmt
.
video
.
i_sar_num
=
p_pasp
->
data
.
p_pasp
->
i_horizontal_spacing
;
p_track
->
fmt
.
video
.
i_sar_den
=
p_pasp
->
data
.
p_pasp
->
i_vertical_spacing
;
}
/* Support for cropping (eg. in H263 files) */
p_track
->
fmt
.
video
.
i_visible_width
=
p_track
->
fmt
.
video
.
i_width
;
p_track
->
fmt
.
video
.
i_visible_height
=
p_track
->
fmt
.
video
.
i_height
;
/* Frame rate */
TrackGetESSampleRate
(
&
p_track
->
fmt
.
video
.
i_frame_rate
,
&
p_track
->
fmt
.
video
.
i_frame_rate_base
,
p_track
,
i_sample_description_index
,
i_chunk
);
p_demux
->
p_sys
->
f_fps
=
(
float
)
p_track
->
fmt
.
video
.
i_frame_rate
/
(
float
)
p_track
->
fmt
.
video
.
i_frame_rate_base
;
break
;
case
AUDIO_ES
:
p_track
->
fmt
.
audio
.
i_channels
=
p_sample
->
data
.
p_sample_soun
->
i_channelcount
;
p_track
->
fmt
.
audio
.
i_rate
=
p_sample
->
data
.
p_sample_soun
->
i_sampleratehi
;
p_track
->
fmt
.
i_bitrate
=
p_sample
->
data
.
p_sample_soun
->
i_channelcount
*
p_sample
->
data
.
p_sample_soun
->
i_sampleratehi
*
p_sample
->
data
.
p_sample_soun
->
i_samplesize
;
p_track
->
fmt
.
audio
.
i_bitspersample
=
p_sample
->
data
.
p_sample_soun
->
i_samplesize
;
if
(
(
p_track
->
i_sample_size
==
1
||
p_track
->
i_sample_size
==
2
)
)
{
MP4_Box_data_sample_soun_t
*
p_soun
;
p_soun
=
p_sample
->
data
.
p_sample_soun
;
p_soun
=
p_sample
->
data
.
p_sample_soun
;
if
(
p_soun
->
i_qt_version
==
0
)
if
(
p_soun
->
i_qt_version
==
0
)
...
@@ -1581,7 +1633,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -1581,7 +1633,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
p_soun
->
i_qt_version
=
0
;
p_soun
->
i_qt_version
=
0
;
}
}
}
}
else
if
(
p_track
->
fmt
.
i_cat
==
AUDIO_ES
&&
p_sample
->
data
.
p_sample_soun
->
i_qt_version
==
1
)
else
if
(
p_sample
->
data
.
p_sample_soun
->
i_qt_version
==
1
)
{
{
MP4_Box_data_sample_soun_t
*
p_soun
=
p_sample
->
data
.
p_sample_soun
;
MP4_Box_data_sample_soun_t
*
p_soun
=
p_sample
->
data
.
p_sample_soun
;
...
@@ -1604,61 +1656,9 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
...
@@ -1604,61 +1656,9 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
}
}
}
}
/* */
switch
(
p_track
->
fmt
.
i_cat
)
{
case
VIDEO_ES
:
p_track
->
fmt
.
video
.
i_width
=
p_sample
->
data
.
p_sample_vide
->
i_width
;
p_track
->
fmt
.
video
.
i_height
=
p_sample
->
data
.
p_sample_vide
->
i_height
;
p_track
->
fmt
.
video
.
i_bits_per_pixel
=
p_sample
->
data
.
p_sample_vide
->
i_depth
;
/* fall on display size */
if
(
p_track
->
fmt
.
video
.
i_width
<=
0
)
p_track
->
fmt
.
video
.
i_width
=
p_track
->
i_width
;
if
(
p_track
->
fmt
.
video
.
i_height
<=
0
)
p_track
->
fmt
.
video
.
i_height
=
p_track
->
i_height
;
/* Find out apect ratio from display size */
if
(
p_track
->
i_width
>
0
&&
p_track
->
i_height
>
0
&&
/* Work-around buggy muxed files */
p_sample
->
data
.
p_sample_vide
->
i_width
!=
p_track
->
i_width
)
{
p_track
->
fmt
.
video
.
i_sar_num
=
p_track
->
i_width
*
p_track
->
fmt
.
video
.
i_height
;
p_track
->
fmt
.
video
.
i_sar_den
=
p_track
->
i_height
*
p_track
->
fmt
.
video
.
i_width
;
}
if
(
p_pasp
&&
p_pasp
->
data
.
p_pasp
->
i_horizontal_spacing
>
0
&&
p_pasp
->
data
.
p_pasp
->
i_vertical_spacing
>
0
)
{
p_track
->
fmt
.
video
.
i_sar_num
=
p_pasp
->
data
.
p_pasp
->
i_horizontal_spacing
;
p_track
->
fmt
.
video
.
i_sar_den
=
p_pasp
->
data
.
p_pasp
->
i_vertical_spacing
;
}
/* Support for cropping (eg. in H263 files) */
p_track
->
fmt
.
video
.
i_visible_width
=
p_track
->
fmt
.
video
.
i_width
;
p_track
->
fmt
.
video
.
i_visible_height
=
p_track
->
fmt
.
video
.
i_height
;
/* Frame rate */
TrackGetESSampleRate
(
&
p_track
->
fmt
.
video
.
i_frame_rate
,
&
p_track
->
fmt
.
video
.
i_frame_rate_base
,
p_track
,
i_sample_description_index
,
i_chunk
);
p_demux
->
p_sys
->
f_fps
=
(
float
)
p_track
->
fmt
.
video
.
i_frame_rate
/
(
float
)
p_track
->
fmt
.
video
.
i_frame_rate_base
;
break
;
case
AUDIO_ES
:
p_track
->
fmt
.
audio
.
i_channels
=
p_sample
->
data
.
p_sample_soun
->
i_channelcount
;
p_track
->
fmt
.
audio
.
i_rate
=
p_sample
->
data
.
p_sample_soun
->
i_sampleratehi
;
p_track
->
fmt
.
i_bitrate
=
p_sample
->
data
.
p_sample_soun
->
i_channelcount
*
p_sample
->
data
.
p_sample_soun
->
i_sampleratehi
*
p_sample
->
data
.
p_sample_soun
->
i_samplesize
;
p_track
->
fmt
.
audio
.
i_bitspersample
=
p_sample
->
data
.
p_sample_soun
->
i_samplesize
;
if
(
p_track
->
i_sample_size
!=
0
&&
if
(
p_track
->
i_sample_size
!=
0
&&
p_sample
->
data
.
p_sample_soun
->
i_qt_version
==
1
&&
p_sample
->
data
.
p_sample_soun
->
i_sample_per_packet
<=
0
)
p_sample
->
data
.
p_sample_soun
->
i_qt_version
==
1
&&
p_sample
->
data
.
p_sample_soun
->
i_sample_per_packet
<=
0
)
{
{
msg_Err
(
p_demux
,
"Invalid sample per packet value for qt_version 1"
);
msg_Err
(
p_demux
,
"Invalid sample per packet value for qt_version 1"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
...
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