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
4e6eeaf0
Commit
4e6eeaf0
authored
Mar 24, 2008
by
Bartlomiej Wolowiec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using stream type in eac3 parser
Originally committed as revision 12570 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
b4e806b2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
1 deletion
+18
-1
aac_ac3_parser.h
libavcodec/aac_ac3_parser.h
+1
-0
aac_parser.c
libavcodec/aac_parser.c
+1
-0
ac3.h
libavcodec/ac3.h
+7
-0
ac3_parser.c
libavcodec/ac3_parser.c
+5
-1
ac3_parser.h
libavcodec/ac3_parser.h
+1
-0
ac3dec.c
libavcodec/ac3dec.c
+3
-0
No files found.
libavcodec/aac_ac3_parser.h
View file @
4e6eeaf0
...
...
@@ -37,6 +37,7 @@ typedef struct AACAC3ParseContext {
int
sample_rate
;
int
bit_rate
;
int
samples
;
uint8_t
stream_type
;
}
AACAC3ParseContext
;
int
ff_aac_ac3_parse
(
AVCodecParserContext
*
s1
,
...
...
libavcodec/aac_parser.c
View file @
4e6eeaf0
...
...
@@ -83,6 +83,7 @@ static int aac_sync(AACAC3ParseContext *hdr_info)
static
av_cold
int
aac_parse_init
(
AVCodecParserContext
*
s1
)
{
AACAC3ParseContext
*
s
=
s1
->
priv_data
;
s
->
stream_type
=
0
;
s
->
inbuf_ptr
=
s
->
inbuf
;
s
->
header_size
=
AAC_HEADER_SIZE
;
s
->
sync
=
aac_sync
;
...
...
libavcodec/ac3.h
View file @
4e6eeaf0
...
...
@@ -84,6 +84,7 @@ typedef struct {
uint8_t
bitstream_id
;
uint8_t
channel_mode
;
uint8_t
lfe_on
;
uint8_t
stream_type
;
/** @} */
/** @defgroup derived Derived values
...
...
@@ -97,6 +98,12 @@ typedef struct {
/** @} */
}
AC3HeaderInfo
;
typedef
enum
{
EAC3_STREAM_TYPE_INDEPENDENT
=
0
,
EAC3_STREAM_TYPE_DEPENDENT
,
EAC3_STREAM_TYPE_AC3_CONVERT
,
EAC3_STREAM_TYPE_RESERVED
}
EAC3StreamType
;
void
ac3_common_init
(
void
);
...
...
libavcodec/ac3_parser.c
View file @
4e6eeaf0
...
...
@@ -84,10 +84,14 @@ int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr)
hdr
->
bit_rate
=
(
ff_ac3_bitrate_tab
[
frame_size_code
>>
1
]
*
1000
)
>>
hdr
->
sr_shift
;
hdr
->
channels
=
ff_ac3_channels_tab
[
hdr
->
channel_mode
]
+
hdr
->
lfe_on
;
hdr
->
frame_size
=
ff_ac3_frame_size_tab
[
frame_size_code
][
hdr
->
sr_code
]
*
2
;
hdr
->
stream_type
=
0
;
}
else
{
/* Enhanced AC-3 */
hdr
->
crc1
=
0
;
skip_bits
(
&
gbc
,
2
);
// skip stream type
hdr
->
stream_type
=
get_bits
(
&
gbc
,
2
);
if
(
hdr
->
stream_type
==
3
)
return
AC3_PARSE_ERROR_STREAM_TYPE
;
skip_bits
(
&
gbc
,
3
);
// skip substream id
hdr
->
frame_size
=
(
get_bits
(
&
gbc
,
11
)
+
1
)
<<
1
;
...
...
libavcodec/ac3_parser.h
View file @
4e6eeaf0
...
...
@@ -30,6 +30,7 @@ typedef enum {
AC3_PARSE_ERROR_BSID
=
-
2
,
AC3_PARSE_ERROR_SAMPLE_RATE
=
-
3
,
AC3_PARSE_ERROR_FRAME_SIZE
=
-
4
,
AC3_PARSE_ERROR_STREAM_TYPE
=
-
5
,
}
AC3ParseError
;
/**
...
...
libavcodec/ac3dec.c
View file @
4e6eeaf0
...
...
@@ -1151,6 +1151,9 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
case
AC3_PARSE_ERROR_FRAME_SIZE
:
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid frame size
\n
"
);
break
;
case
AC3_PARSE_ERROR_STREAM_TYPE
:
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid stream type
\n
"
);
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid header
\n
"
);
break
;
...
...
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