Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
c9b3498a
Commit
c9b3498a
authored
May 15, 2006
by
J. Alexander Treuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around a stupid bug in libmad so VBR MP3s with CRC protection have the correct length.
git-svn-id:
https://svn.musicpd.org/mpd/trunk@4184
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
58150720
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
mp3_plugin.c
src/inputPlugins/mp3_plugin.c
+17
-4
No files found.
src/inputPlugins/mp3_plugin.c
View file @
c9b3498a
...
@@ -154,7 +154,7 @@ void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream) {
...
@@ -154,7 +154,7 @@ void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream) {
memset
(
&
(
data
->
dither
),
0
,
sizeof
(
struct
audio_dither
));
memset
(
&
(
data
->
dither
),
0
,
sizeof
(
struct
audio_dither
));
mad_stream_init
(
&
data
->
stream
);
mad_stream_init
(
&
data
->
stream
);
data
->
stream
.
options
|=
MAD_OPTION_IGNORECRC
;
mad_stream_options
(
&
data
->
stream
,
MAD_OPTION_IGNORECRC
)
;
mad_frame_init
(
&
data
->
frame
);
mad_frame_init
(
&
data
->
frame
);
mad_synth_init
(
&
data
->
synth
);
mad_synth_init
(
&
data
->
synth
);
mad_timer_reset
(
&
data
->
timer
);
mad_timer_reset
(
&
data
->
timer
);
...
@@ -397,7 +397,8 @@ int decodeNextFrame(mp3DecodeData * data) {
...
@@ -397,7 +397,8 @@ int decodeNextFrame(mp3DecodeData * data) {
}
}
/* xing stuff stolen from alsaplayer */
/* xing stuff stolen from alsaplayer */
# define XING_MAGIC (('X' << 24) | ('i' << 16) | ('n' << 8) | 'g')
#define XI_MAGIC (('X' << 8) | 'i')
#define NG_MAGIC (('n' << 8) | 'g')
struct
xing
{
struct
xing
{
long
flags
;
/* valid fields (see below) */
long
flags
;
/* valid fields (see below) */
...
@@ -416,10 +417,22 @@ enum {
...
@@ -416,10 +417,22 @@ enum {
int
parse_xing
(
struct
xing
*
xing
,
struct
mad_bitptr
ptr
,
unsigned
int
bitlen
)
int
parse_xing
(
struct
xing
*
xing
,
struct
mad_bitptr
ptr
,
unsigned
int
bitlen
)
{
{
if
(
bitlen
<
64
||
mad_bit_read
(
&
ptr
,
32
)
!=
XING_MAGIC
)
goto
fail
;
unsigned
long
bits
;
if
(
bitlen
<
16
)
goto
fail
;
bits
=
mad_bit_read
(
&
ptr
,
16
);
bitlen
-=
16
;
if
(
bits
==
XI_MAGIC
)
{
if
(
bitlen
<
16
)
goto
fail
;
if
(
mad_bit_read
(
&
ptr
,
16
)
!=
NG_MAGIC
)
goto
fail
;
bitlen
-=
16
;
}
else
if
(
bits
!=
NG_MAGIC
)
goto
fail
;
if
(
bitlen
<
32
)
goto
fail
;
xing
->
flags
=
mad_bit_read
(
&
ptr
,
32
);
xing
->
flags
=
mad_bit_read
(
&
ptr
,
32
);
bitlen
-=
64
;
bitlen
-=
32
;
if
(
xing
->
flags
&
XING_FRAMES
)
{
if
(
xing
->
flags
&
XING_FRAMES
)
{
if
(
bitlen
<
32
)
goto
fail
;
if
(
bitlen
<
32
)
goto
fail
;
...
...
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