Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
9bb8de34
Commit
9bb8de34
authored
Oct 28, 2005
by
Steve Lhomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mkv.cpp: support the new A_AAC codec ID and SBR for older IDs (more tests needed)
parent
714029c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
modules/demux/mkv.cpp
modules/demux/mkv.cpp
+31
-4
No files found.
modules/demux/mkv.cpp
View file @
9bb8de34
...
@@ -589,6 +589,9 @@ typedef struct
...
@@ -589,6 +589,9 @@ typedef struct
float
f_fps
;
float
f_fps
;
es_out_id_t
*
p_es
;
es_out_id_t
*
p_es
;
/* audio */
unsigned
int
i_original_rate
;
vlc_bool_t
b_inited
;
vlc_bool_t
b_inited
;
/* data to be send first */
/* data to be send first */
int
i_data_init
;
int
i_data_init
;
...
@@ -2318,7 +2321,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
...
@@ -2318,7 +2321,7 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
else
if
(
!
strncmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_AAC/MPEG2/"
,
strlen
(
"A_AAC/MPEG2/"
)
)
||
else
if
(
!
strncmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_AAC/MPEG2/"
,
strlen
(
"A_AAC/MPEG2/"
)
)
||
!
strncmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_AAC/MPEG4/"
,
strlen
(
"A_AAC/MPEG4/"
)
)
)
!
strncmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_AAC/MPEG4/"
,
strlen
(
"A_AAC/MPEG4/"
)
)
)
{
{
int
i_profile
,
i_srate
;
int
i_profile
,
i_srate
,
sbr
=
0
;
static
unsigned
int
i_sample_rates
[]
=
static
unsigned
int
i_sample_rates
[]
=
{
{
96000
,
88200
,
64000
,
48000
,
44100
,
32000
,
24000
,
22050
,
96000
,
88200
,
64000
,
48000
,
44100
,
32000
,
24000
,
22050
,
...
@@ -2340,6 +2343,11 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
...
@@ -2340,6 +2343,11 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
{
{
i_profile
=
2
;
i_profile
=
2
;
}
}
else
if
(
!
strcmp
(
&
tracks
[
i_track
]
->
psz_codec
[
12
],
"LC/SBR"
)
)
{
i_profile
=
1
;
sbr
=
1
;
}
else
else
{
{
i_profile
=
3
;
i_profile
=
3
;
...
@@ -2347,23 +2355,35 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
...
@@ -2347,23 +2355,35 @@ bool matroska_segment_c::Select( mtime_t i_start_time )
for
(
i_srate
=
0
;
i_srate
<
13
;
i_srate
++
)
for
(
i_srate
=
0
;
i_srate
<
13
;
i_srate
++
)
{
{
if
(
i_sample_rates
[
i_srate
]
==
tracks
[
i_track
]
->
fmt
.
audio
.
i
_rate
)
if
(
i_sample_rates
[
i_srate
]
==
tracks
[
i_track
]
->
i_original
_rate
)
{
{
break
;
break
;
}
}
}
}
msg_Dbg
(
&
sys
.
demuxer
,
"profile=%d srate=%d"
,
i_profile
,
i_srate
);
msg_Dbg
(
&
sys
.
demuxer
,
"profile=%d srate=%d"
,
i_profile
,
i_srate
);
tracks
[
i_track
]
->
fmt
.
i_extra
=
2
;
tracks
[
i_track
]
->
fmt
.
i_extra
=
sbr
?
5
:
2
;
tracks
[
i_track
]
->
fmt
.
p_extra
=
malloc
(
tracks
[
i_track
]
->
fmt
.
i_extra
);
tracks
[
i_track
]
->
fmt
.
p_extra
=
malloc
(
tracks
[
i_track
]
->
fmt
.
i_extra
);
((
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
)[
0
]
=
((
i_profile
+
1
)
<<
3
)
|
((
i_srate
&
0xe
)
>>
1
);
((
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
)[
0
]
=
((
i_profile
+
1
)
<<
3
)
|
((
i_srate
&
0xe
)
>>
1
);
((
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
)[
1
]
=
((
i_srate
&
0x1
)
<<
7
)
|
(
tracks
[
i_track
]
->
fmt
.
audio
.
i_channels
<<
3
);
((
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
)[
1
]
=
((
i_srate
&
0x1
)
<<
7
)
|
(
tracks
[
i_track
]
->
fmt
.
audio
.
i_channels
<<
3
);
if
(
sbr
!=
0
)
{
int
syncExtensionType
=
0x2B7
;
int
iDSRI
;
for
(
iDSRI
=
0
;
iDSRI
<
13
;
iDSRI
++
)
if
(
i_sample_rates
[
iDSRI
]
==
tracks
[
i_track
]
->
fmt
.
audio
.
i_rate
)
break
;
((
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
)[
2
]
=
(
syncExtensionType
>>
3
)
&
0xFF
;
((
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
)[
3
]
=
((
syncExtensionType
&
0x7
)
<<
5
)
|
5
;
((
uint8_t
*
)
tracks
[
i_track
]
->
fmt
.
p_extra
)[
4
]
=
((
1
&
0x1
)
<<
7
)
|
(
iDSRI
<<
3
);
}
}
}
else
if
(
!
strcmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_AAC"
)
)
else
if
(
!
strcmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_AAC"
)
)
{
{
tracks
[
i_track
]
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
tracks
[
i_track
]
->
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
tracks
[
i_track
]
->
fmt
.
i_extra
=
tracks
[
i_track
]
->
i_extra_data
;
tracks
[
i_track
]
->
fmt
.
i_extra
=
tracks
[
i_track
]
->
i_extra_data
;
tracks
[
i_track
]
->
fmt
.
p_extra
=
malloc
(
tracks
[
i_track
]
->
i_extra_data
);
tracks
[
i_track
]
->
fmt
.
p_extra
=
malloc
(
tracks
[
i_track
]
->
i_extra_data
);
memcpy
(
tracks
[
i_track
]
->
fmt
.
p_extra
,
tracks
[
i_track
]
->
p_extra_data
,
tracks
[
i_track
]
->
i_extra_data
);
}
}
else
if
(
!
strcmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_PCM/INT/BIG"
)
||
else
if
(
!
strcmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_PCM/INT/BIG"
)
||
!
strcmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_PCM/INT/LIT"
)
||
!
strcmp
(
tracks
[
i_track
]
->
psz_codec
,
"A_PCM/INT/LIT"
)
||
...
@@ -4415,9 +4435,16 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
...
@@ -4415,9 +4435,16 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
{
{
KaxAudioSamplingFreq
&
afreq
=
*
(
KaxAudioSamplingFreq
*
)
l
;
KaxAudioSamplingFreq
&
afreq
=
*
(
KaxAudioSamplingFreq
*
)
l
;
tk
->
fmt
.
audio
.
i_rate
=
(
int
)
float
(
afreq
);
tk
->
i_original_rate
=
tk
->
fmt
.
audio
.
i_rate
=
(
int
)
float
(
afreq
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | | | + afreq=%d"
,
tk
->
fmt
.
audio
.
i_rate
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | | | + afreq=%d"
,
tk
->
fmt
.
audio
.
i_rate
);
}
}
else
if
(
MKV_IS_ID
(
l
,
KaxAudioOutputSamplingFreq
)
)
{
KaxAudioOutputSamplingFreq
&
afreq
=
*
(
KaxAudioOutputSamplingFreq
*
)
l
;
tk
->
fmt
.
audio
.
i_rate
=
(
int
)
float
(
afreq
);
msg_Dbg
(
&
sys
.
demuxer
,
"| | | | + aoutfreq=%d"
,
tk
->
fmt
.
audio
.
i_rate
);
}
else
if
(
MKV_IS_ID
(
l
,
KaxAudioChannels
)
)
else
if
(
MKV_IS_ID
(
l
,
KaxAudioChannels
)
)
{
{
KaxAudioChannels
&
achan
=
*
(
KaxAudioChannels
*
)
l
;
KaxAudioChannels
&
achan
=
*
(
KaxAudioChannels
*
)
l
;
...
...
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