Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
3798205a
Commit
3798205a
authored
Feb 12, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: set channel layout for AC-3 streams based on the 'dac3' atom info
fixes Bug 225
parent
1254022e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
5 deletions
+10
-5
Makefile
libavcodec/Makefile
+1
-1
ac3_parser.c
libavcodec/ac3_parser.c
+1
-1
ac3dec.c
libavcodec/ac3dec.c
+1
-1
ac3tab.c
libavcodec/ac3tab.c
+1
-1
ac3tab.h
libavcodec/ac3tab.h
+1
-1
mov.c
libavformat/mov.c
+5
-0
No files found.
libavcodec/Makefile
View file @
3798205a
...
@@ -556,7 +556,7 @@ OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
...
@@ -556,7 +556,7 @@ OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
flacdec.o
flacdata.o
flac.o
\
flacdec.o
flacdata.o
flac.o
\
mpegaudiodata.o
mpegaudiodata.o
OBJS-$(CONFIG_MP3_MUXER)
+=
mpegaudiodata.o
mpegaudiodecheader.o
OBJS-$(CONFIG_MP3_MUXER)
+=
mpegaudiodata.o
mpegaudiodecheader.o
OBJS-$(CONFIG_MOV_DEMUXER)
+=
mpeg4audio.o
mpegaudiodata.o
OBJS-$(CONFIG_MOV_DEMUXER)
+=
mpeg4audio.o
mpegaudiodata.o
ac3tab.o
OBJS-$(CONFIG_MOV_MUXER)
+=
mpeg4audio.o
mpegaudiodata.o
OBJS-$(CONFIG_MOV_MUXER)
+=
mpeg4audio.o
mpegaudiodata.o
OBJS-$(CONFIG_MPEGTS_MUXER)
+=
mpegvideo.o
mpeg4audio.o
OBJS-$(CONFIG_MPEGTS_MUXER)
+=
mpegvideo.o
mpeg4audio.o
OBJS-$(CONFIG_MPEGTS_DEMUXER)
+=
mpeg4audio.o
mpegaudiodata.o
OBJS-$(CONFIG_MPEGTS_DEMUXER)
+=
mpeg4audio.o
mpegaudiodata.o
...
...
libavcodec/ac3_parser.c
View file @
3798205a
...
@@ -134,7 +134,7 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
...
@@ -134,7 +134,7 @@ int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
(
hdr
->
num_blocks
*
256
.
0
));
(
hdr
->
num_blocks
*
256
.
0
));
hdr
->
channels
=
ff_ac3_channels_tab
[
hdr
->
channel_mode
]
+
hdr
->
lfe_on
;
hdr
->
channels
=
ff_ac3_channels_tab
[
hdr
->
channel_mode
]
+
hdr
->
lfe_on
;
}
}
hdr
->
channel_layout
=
ff
_ac3_channel_layout_tab
[
hdr
->
channel_mode
];
hdr
->
channel_layout
=
avpriv
_ac3_channel_layout_tab
[
hdr
->
channel_mode
];
if
(
hdr
->
lfe_on
)
if
(
hdr
->
lfe_on
)
hdr
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
hdr
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
...
...
libavcodec/ac3dec.c
View file @
3798205a
...
@@ -1378,7 +1378,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
...
@@ -1378,7 +1378,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
avctx
->
request_channels
<
s
->
channels
)
{
avctx
->
request_channels
<
s
->
channels
)
{
s
->
out_channels
=
avctx
->
request_channels
;
s
->
out_channels
=
avctx
->
request_channels
;
s
->
output_mode
=
avctx
->
request_channels
==
1
?
AC3_CHMODE_MONO
:
AC3_CHMODE_STEREO
;
s
->
output_mode
=
avctx
->
request_channels
==
1
?
AC3_CHMODE_MONO
:
AC3_CHMODE_STEREO
;
s
->
channel_layout
=
ff
_ac3_channel_layout_tab
[
s
->
output_mode
];
s
->
channel_layout
=
avpriv
_ac3_channel_layout_tab
[
s
->
output_mode
];
}
}
avctx
->
channels
=
s
->
out_channels
;
avctx
->
channels
=
s
->
out_channels
;
avctx
->
channel_layout
=
s
->
channel_layout
;
avctx
->
channel_layout
=
s
->
channel_layout
;
...
...
libavcodec/ac3tab.c
View file @
3798205a
...
@@ -84,7 +84,7 @@ const uint8_t ff_ac3_channels_tab[8] = {
...
@@ -84,7 +84,7 @@ const uint8_t ff_ac3_channels_tab[8] = {
/**
/**
* Map audio coding mode (acmod) to channel layout mask.
* Map audio coding mode (acmod) to channel layout mask.
*/
*/
const
uint16_t
ff
_ac3_channel_layout_tab
[
8
]
=
{
const
uint16_t
avpriv
_ac3_channel_layout_tab
[
8
]
=
{
AV_CH_LAYOUT_STEREO
,
AV_CH_LAYOUT_STEREO
,
AV_CH_LAYOUT_MONO
,
AV_CH_LAYOUT_MONO
,
AV_CH_LAYOUT_STEREO
,
AV_CH_LAYOUT_STEREO
,
...
...
libavcodec/ac3tab.h
View file @
3798205a
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
extern
const
uint16_t
ff_ac3_frame_size_tab
[
38
][
3
];
extern
const
uint16_t
ff_ac3_frame_size_tab
[
38
][
3
];
extern
const
uint8_t
ff_ac3_channels_tab
[
8
];
extern
const
uint8_t
ff_ac3_channels_tab
[
8
];
extern
const
uint16_t
ff
_ac3_channel_layout_tab
[
8
];
extern
const
uint16_t
avpriv
_ac3_channel_layout_tab
[
8
];
extern
const
uint8_t
ff_ac3_enc_channel_map
[
8
][
2
][
6
];
extern
const
uint8_t
ff_ac3_enc_channel_map
[
8
][
2
][
6
];
extern
const
uint8_t
ff_ac3_dec_channel_map
[
8
][
2
][
6
];
extern
const
uint8_t
ff_ac3_dec_channel_map
[
8
][
2
][
6
];
extern
const
uint16_t
ff_ac3_sample_rate_tab
[
3
];
extern
const
uint16_t
ff_ac3_sample_rate_tab
[
3
];
...
...
libavformat/mov.c
View file @
3798205a
...
@@ -25,11 +25,13 @@
...
@@ -25,11 +25,13 @@
//#define DEBUG
//#define DEBUG
//#define MOV_EXPORT_ALL_METADATA
//#define MOV_EXPORT_ALL_METADATA
#include "libavutil/audioconvert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat.h"
#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/mathematics.h"
#include "libavutil/avstring.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/dict.h"
#include "libavcodec/ac3tab.h"
#include "avformat.h"
#include "avformat.h"
#include "internal.h"
#include "internal.h"
#include "avio_internal.h"
#include "avio_internal.h"
...
@@ -552,6 +554,9 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -552,6 +554,9 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
acmod
=
(
ac3info
>>
11
)
&
0x7
;
acmod
=
(
ac3info
>>
11
)
&
0x7
;
lfeon
=
(
ac3info
>>
10
)
&
0x1
;
lfeon
=
(
ac3info
>>
10
)
&
0x1
;
st
->
codec
->
channels
=
((
int
[]){
2
,
1
,
2
,
3
,
3
,
4
,
4
,
5
})[
acmod
]
+
lfeon
;
st
->
codec
->
channels
=
((
int
[]){
2
,
1
,
2
,
3
,
3
,
4
,
4
,
5
})[
acmod
]
+
lfeon
;
st
->
codec
->
channel_layout
=
avpriv_ac3_channel_layout_tab
[
acmod
];
if
(
lfeon
)
st
->
codec
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
st
->
codec
->
audio_service_type
=
bsmod
;
st
->
codec
->
audio_service_type
=
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
;
st
->
codec
->
audio_service_type
=
AV_AUDIO_SERVICE_TYPE_KARAOKE
;
...
...
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