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
5cbae565
Commit
5cbae565
authored
Feb 13, 2015
by
Gilles Chanteperdrix
Committed by
Martin Storsjö
Feb 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpegaudio_parser: add MP3 ADU headers parser
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
5e5583ef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
mpegaudio_parser.c
libavcodec/mpegaudio_parser.c
+12
-1
mpegaudiodecheader.c
libavcodec/mpegaudiodecheader.c
+2
-1
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/mpegaudio_parser.c
View file @
5cbae565
...
...
@@ -63,6 +63,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
}
else
{
while
(
i
<
buf_size
){
int
ret
,
sr
,
channels
,
bit_rate
,
frame_size
;
enum
AVCodecID
codec_id
=
avctx
->
codec_id
;
state
=
(
state
<<
8
)
+
buf
[
i
++
];
...
...
@@ -86,6 +87,16 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
avctx
->
bit_rate
+=
(
bit_rate
-
avctx
->
bit_rate
)
/
s
->
header_count
;
}
}
if
(
s1
->
flags
&
PARSER_FLAG_COMPLETE_FRAMES
)
{
s
->
frame_size
=
0
;
next
=
buf_size
;
}
else
if
(
codec_id
==
AV_CODEC_ID_MP3ADU
)
{
avpriv_report_missing_feature
(
avctx
,
"MP3ADU full parser"
);
return
AVERROR_PATCHWELCOME
;
}
break
;
}
}
...
...
@@ -106,7 +117,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
AVCodecParser
ff_mpegaudio_parser
=
{
.
codec_ids
=
{
AV_CODEC_ID_MP1
,
AV_CODEC_ID_MP2
,
AV_CODEC_ID_MP3
},
.
codec_ids
=
{
AV_CODEC_ID_MP1
,
AV_CODEC_ID_MP2
,
AV_CODEC_ID_MP3
,
AV_CODEC_ID_MP3ADU
},
.
priv_data_size
=
sizeof
(
MpegAudioParseContext
),
.
parser_parse
=
mpegaudio_parse
,
.
parser_close
=
ff_parse_close
,
...
...
libavcodec/mpegaudiodecheader.c
View file @
5cbae565
...
...
@@ -134,7 +134,8 @@ int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_r
break
;
default:
case
3
:
avctx
->
codec_id
=
AV_CODEC_ID_MP3
;
if
(
avctx
->
codec_id
!=
AV_CODEC_ID_MP3ADU
)
avctx
->
codec_id
=
AV_CODEC_ID_MP3
;
if
(
s
->
lsf
)
*
frame_size
=
576
;
else
...
...
libavcodec/version.h
View file @
5cbae565
...
...
@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
#define LIBAVCODEC_VERSION_MINOR 1
5
#define LIBAVCODEC_VERSION_MINOR 1
6
#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
...
...
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