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
7da0a072
Commit
7da0a072
authored
May 08, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3demux: fix id3 discard code
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f46185c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
mp3dec.c
libavformat/mp3dec.c
+14
-0
No files found.
libavformat/mp3dec.c
View file @
7da0a072
...
...
@@ -29,6 +29,10 @@
#include "id3v1.h"
#include "libavcodec/mpegaudiodecheader.h"
typedef
struct
{
int64_t
filesize
;
}
MP3Context
;
/* mp3 read */
static
int
mp3_read_probe
(
AVProbeData
*
p
)
...
...
@@ -136,6 +140,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
static
int
mp3_read_header
(
AVFormatContext
*
s
)
{
MP3Context
*
mp3
=
s
->
priv_data
;
AVStream
*
st
;
int64_t
off
;
...
...
@@ -157,6 +162,9 @@ static int mp3_read_header(AVFormatContext *s)
if
(
!
av_dict_get
(
s
->
metadata
,
""
,
NULL
,
AV_DICT_IGNORE_SUFFIX
))
ff_id3v1_read
(
s
);
if
(
s
->
pb
->
seekable
)
mp3
->
filesize
=
avio_size
(
s
->
pb
);
if
(
mp3_parse_vbr_tags
(
s
,
st
,
off
)
<
0
)
avio_seek
(
s
->
pb
,
off
,
SEEK_SET
);
...
...
@@ -168,10 +176,15 @@ static int mp3_read_header(AVFormatContext *s)
static
int
mp3_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
MP3Context
*
mp3
=
s
->
priv_data
;
int
ret
,
size
;
int64_t
pos
;
// AVStream *st = s->streams[0];
size
=
MP3_PACKET_SIZE
;
pos
=
avio_tell
(
s
->
pb
);
if
(
mp3
->
filesize
>
ID3v1_TAG_SIZE
&&
pos
<
mp3
->
filesize
)
size
=
FFMIN
(
size
,
mp3
->
filesize
-
pos
);
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
size
);
...
...
@@ -196,6 +209,7 @@ static int mp3_read_packet(AVFormatContext *s, AVPacket *pkt)
AVInputFormat
ff_mp3_demuxer
=
{
.
name
=
"mp3"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"MPEG audio layer 2/3"
),
.
priv_data_size
=
sizeof
(
MP3Context
),
.
read_probe
=
mp3_read_probe
,
.
read_header
=
mp3_read_header
,
.
read_packet
=
mp3_read_packet
,
...
...
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