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
4e4faf61
Commit
4e4faf61
authored
Mar 05, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see if we can skip past tags
git-svn-id:
https://svn.musicpd.org/mpd/trunk@199
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
124854ff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
decode.c
src/decode.c
+2
-4
mp3_decode.c
src/mp3_decode.c
+33
-2
No files found.
src/decode.c
View file @
4e4faf61
...
...
@@ -47,8 +47,6 @@
#include <unistd.h>
#include <string.h>
#define FADE_CHUNKS 1024
int
*
decode_pid
=
NULL
;
void
decodeSigHandler
(
int
sig
)
{
...
...
@@ -91,7 +89,7 @@ void quitDecode(PlayerControl * pc, DecoderControl * dc) {
}
int
calculateCrossFadeChunks
(
PlayerControl
*
pc
,
AudioFormat
*
af
)
{
int
chunks
;
long
chunks
;
if
(
pc
->
crossFade
<=
0
)
return
0
;
...
...
@@ -104,7 +102,7 @@ int calculateCrossFadeChunks(PlayerControl * pc, AudioFormat * af) {
if
(
chunks
<
0
)
chunks
=
0
;
return
chunks
;
return
(
int
)
chunks
;
}
int
waitOnDecode
(
PlayerControl
*
pc
,
AudioFormat
*
af
,
DecoderControl
*
dc
,
...
...
src/mp3_decode.c
View file @
4e4faf61
...
...
@@ -25,6 +25,13 @@
#else
#include <mad.h>
#endif
#ifdef HAVE_ID3TAG
#ifdef USE_MPD_ID3TAG
#include "libid3tag/id3tag.h"
#else
#include <id3tag.h>
#endif
#endif
#include "playerData.h"
#include "log.h"
...
...
@@ -181,7 +188,19 @@ int decodeNextFrameHeader(mp3DecodeData * data) {
}
}
if
(
mad_header_decode
(
&
data
->
frame
.
header
,
&
data
->
stream
))
{
if
((
data
->
stream
).
error
==
MAD_ERROR_LOSTSYNC
)
return
DECODE_SKIP
;
if
((
data
->
stream
).
error
==
MAD_ERROR_LOSTSYNC
)
{
#ifdef HAVE_ID3TAG
signed
long
tagsize
=
id3_tag_query
(
(
data
->
stream
).
this_frame
,
(
data
->
stream
).
bufend
-
(
data
->
stream
).
this_frame
);
if
(
tagsize
>
0
)
{
mad_stream_skip
(
&
(
data
->
stream
),
tagsize
);
return
DECODE_CONT
;
}
#endif
return
DECODE_SKIP
;
}
if
(
MAD_RECOVERABLE
((
data
->
stream
).
error
))
return
DECODE_CONT
;
else
{
if
((
data
->
stream
).
error
==
MAD_ERROR_BUFLEN
)
return
DECODE_CONT
;
...
...
@@ -206,7 +225,19 @@ int decodeNextFrame(mp3DecodeData * data) {
}
}
if
(
mad_frame_decode
(
&
data
->
frame
,
&
data
->
stream
))
{
if
((
data
->
stream
).
error
==
MAD_ERROR_LOSTSYNC
)
return
DECODE_SKIP
;
if
((
data
->
stream
).
error
==
MAD_ERROR_LOSTSYNC
)
{
#ifdef HAVE_ID3TAG
signed
long
tagsize
=
id3_tag_query
(
(
data
->
stream
).
this_frame
,
(
data
->
stream
).
bufend
-
(
data
->
stream
).
this_frame
);
if
(
tagsize
>
0
)
{
mad_stream_skip
(
&
(
data
->
stream
),
tagsize
);
return
DECODE_CONT
;
}
#endif
return
DECODE_SKIP
;
}
if
(
MAD_RECOVERABLE
((
data
->
stream
).
error
))
return
DECODE_CONT
;
else
{
if
((
data
->
stream
).
error
==
MAD_ERROR_BUFLEN
)
return
DECODE_CONT
;
...
...
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