Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
32125781
Commit
32125781
authored
Nov 14, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: export audio service type as side data
parent
4227e4fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
mov.c
libavformat/mov.c
+20
-4
No files found.
libavformat/mov.c
View file @
32125781
...
@@ -620,12 +620,18 @@ static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -620,12 +620,18 @@ static int mov_read_esds(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static
int
mov_read_dac3
(
MOVContext
*
c
,
AVIOContext
*
pb
,
MOVAtom
atom
)
static
int
mov_read_dac3
(
MOVContext
*
c
,
AVIOContext
*
pb
,
MOVAtom
atom
)
{
{
AVStream
*
st
;
AVStream
*
st
;
enum
AVAudioServiceType
*
ast
;
int
ac3info
,
acmod
,
lfeon
,
bsmod
;
int
ac3info
,
acmod
,
lfeon
,
bsmod
;
if
(
c
->
fc
->
nb_streams
<
1
)
if
(
c
->
fc
->
nb_streams
<
1
)
return
0
;
return
0
;
st
=
c
->
fc
->
streams
[
c
->
fc
->
nb_streams
-
1
];
st
=
c
->
fc
->
streams
[
c
->
fc
->
nb_streams
-
1
];
ast
=
(
enum
AVAudioServiceType
*
)
ff_stream_new_side_data
(
st
,
AV_PKT_DATA_AUDIO_SERVICE_TYPE
,
sizeof
(
*
ast
));
if
(
!
ast
)
return
AVERROR
(
ENOMEM
);
ac3info
=
avio_rb24
(
pb
);
ac3info
=
avio_rb24
(
pb
);
bsmod
=
(
ac3info
>>
14
)
&
0x7
;
bsmod
=
(
ac3info
>>
14
)
&
0x7
;
acmod
=
(
ac3info
>>
11
)
&
0x7
;
acmod
=
(
ac3info
>>
11
)
&
0x7
;
...
@@ -634,9 +640,11 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -634,9 +640,11 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
st
->
codec
->
channel_layout
=
avpriv_ac3_channel_layout_tab
[
acmod
];
st
->
codec
->
channel_layout
=
avpriv_ac3_channel_layout_tab
[
acmod
];
if
(
lfeon
)
if
(
lfeon
)
st
->
codec
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
st
->
codec
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
st
->
codec
->
audio_service_type
=
bsmod
;
*
ast
=
bsmod
;
if
(
st
->
codec
->
channels
>
1
&&
bsmod
==
0x7
)
if
(
st
->
codec
->
channels
>
1
&&
bsmod
==
0x7
)
st
->
codec
->
audio_service_type
=
AV_AUDIO_SERVICE_TYPE_KARAOKE
;
*
ast
=
AV_AUDIO_SERVICE_TYPE_KARAOKE
;
st
->
codec
->
audio_service_type
=
*
ast
;
return
0
;
return
0
;
}
}
...
@@ -644,12 +652,18 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -644,12 +652,18 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static
int
mov_read_dec3
(
MOVContext
*
c
,
AVIOContext
*
pb
,
MOVAtom
atom
)
static
int
mov_read_dec3
(
MOVContext
*
c
,
AVIOContext
*
pb
,
MOVAtom
atom
)
{
{
AVStream
*
st
;
AVStream
*
st
;
enum
AVAudioServiceType
*
ast
;
int
eac3info
,
acmod
,
lfeon
,
bsmod
;
int
eac3info
,
acmod
,
lfeon
,
bsmod
;
if
(
c
->
fc
->
nb_streams
<
1
)
if
(
c
->
fc
->
nb_streams
<
1
)
return
0
;
return
0
;
st
=
c
->
fc
->
streams
[
c
->
fc
->
nb_streams
-
1
];
st
=
c
->
fc
->
streams
[
c
->
fc
->
nb_streams
-
1
];
ast
=
(
enum
AVAudioServiceType
*
)
ff_stream_new_side_data
(
st
,
AV_PKT_DATA_AUDIO_SERVICE_TYPE
,
sizeof
(
*
ast
));
if
(
!
ast
)
return
AVERROR
(
ENOMEM
);
/* No need to parse fields for additional independent substreams and its
/* No need to parse fields for additional independent substreams and its
* associated dependent substreams since libavcodec's E-AC-3 decoder
* associated dependent substreams since libavcodec's E-AC-3 decoder
* does not support them yet. */
* does not support them yet. */
...
@@ -662,9 +676,11 @@ static int mov_read_dec3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -662,9 +676,11 @@ static int mov_read_dec3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if
(
lfeon
)
if
(
lfeon
)
st
->
codec
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
st
->
codec
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
st
->
codec
->
channels
=
av_get_channel_layout_nb_channels
(
st
->
codec
->
channel_layout
);
st
->
codec
->
channels
=
av_get_channel_layout_nb_channels
(
st
->
codec
->
channel_layout
);
st
->
codec
->
audio_service_type
=
bsmod
;
*
ast
=
bsmod
;
if
(
st
->
codec
->
channels
>
1
&&
bsmod
==
0x7
)
if
(
st
->
codec
->
channels
>
1
&&
bsmod
==
0x7
)
st
->
codec
->
audio_service_type
=
AV_AUDIO_SERVICE_TYPE_KARAOKE
;
*
ast
=
AV_AUDIO_SERVICE_TYPE_KARAOKE
;
st
->
codec
->
audio_service_type
=
*
ast
;
return
0
;
return
0
;
}
}
...
...
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