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
72609e68
Commit
72609e68
authored
Nov 10, 2008
by
Led
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.12.0rc3
parent
c8b0ef45
Hide whitespace changes
Inline
Side-by-side
Showing
54 changed files
with
217 additions
and
214 deletions
+217
-214
configure
configure
+10
-10
configure.ac
configure.ac
+3
-3
audio.h
src/audio.h
+8
-8
audioOutput.h
src/audioOutput.h
+3
-2
audioOutput_alsa.c
src/audioOutputs/audioOutput_alsa.c
+2
-2
audioOutput_oss.c
src/audioOutputs/audioOutput_oss.c
+1
-1
charConv.c
src/charConv.c
+2
-2
command.c
src/command.c
+1
-1
command.h
src/command.h
+2
-2
conf.c
src/conf.c
+2
-2
conf.h
src/conf.h
+2
-2
dbUtils.h
src/dbUtils.h
+1
-1
decode.c
src/decode.c
+1
-1
decode.h
src/decode.h
+1
-1
directory.c
src/directory.c
+5
-5
directory.h
src/directory.h
+9
-9
inputPlugin.h
src/inputPlugin.h
+2
-2
_flac_common.c
src/inputPlugins/_flac_common.c
+6
-6
_ogg_common.c
src/inputPlugins/_ogg_common.c
+1
-1
aac_plugin.c
src/inputPlugins/aac_plugin.c
+2
-2
flac_plugin.c
src/inputPlugins/flac_plugin.c
+1
-1
mp3_plugin.c
src/inputPlugins/mp3_plugin.c
+23
-16
oggflac_plugin.c
src/inputPlugins/oggflac_plugin.c
+2
-2
oggvorbis_plugin.c
src/inputPlugins/oggvorbis_plugin.c
+2
-2
inputStream.h
src/inputStream.h
+1
-1
inputStream_file.h
src/inputStream_file.h
+1
-1
inputStream_http.h
src/inputStream_http.h
+1
-1
interface.c
src/interface.c
+2
-2
interface.h
src/interface.h
+4
-4
listen.h
src/listen.h
+3
-3
log.c
src/log.c
+4
-4
log.h
src/log.h
+1
-1
ls.c
src/ls.c
+1
-1
mp4ff.c
src/mp4ff/mp4ff.c
+13
-11
mp4tagupdate.c
src/mp4ff/mp4tagupdate.c
+17
-17
myfprintf.c
src/myfprintf.c
+1
-1
normalize.h
src/normalize.h
+2
-2
path.h
src/path.h
+3
-3
permission.h
src/permission.h
+4
-3
player.c
src/player.c
+1
-1
player.h
src/player.h
+21
-21
playerData.c
src/playerData.c
+1
-1
playerData.h
src/playerData.h
+3
-3
playlist.c
src/playlist.c
+8
-8
playlist.h
src/playlist.h
+10
-10
replayGain.h
src/replayGain.h
+2
-2
sig_handlers.c
src/sig_handlers.c
+1
-1
sig_handlers.h
src/sig_handlers.h
+9
-9
song.h
src/song.h
+2
-2
stats.h
src/stats.h
+1
-1
tag.h
src/tag.h
+2
-2
tree.c
src/tree.c
+1
-2
utils.h
src/utils.h
+1
-8
volume.h
src/volume.h
+4
-4
No files found.
configure
View file @
72609e68
#
! /bin/sh
#
Guess
values
for
system
-
dependent
variables
and
create
Makefiles
.
#
Generated
by
GNU
Autoconf
2.59
for
mpd
0.12.0
rc
2
.
#
Generated
by
GNU
Autoconf
2.59
for
mpd
0.12.0
rc
3
.
#
#
Report
bugs
to
<
warren
.
dukes
@
gmail
.
com
>.
#
...
...
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='
mpd
'
PACKAGE_TARNAME='
mpd
'
PACKAGE_VERSION='
0.12.0
rc
2
'
PACKAGE_STRING='
mpd
0.12.0
rc
2
'
PACKAGE_VERSION='
0.12.0
rc
3
'
PACKAGE_STRING='
mpd
0.12.0
rc
3
'
PACKAGE_BUGREPORT='
warren
.
dukes
@
gmail
.
com
'
# Factoring default headers for most tests.
...
...
@@ -965,7 +965,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures mpd 0.12.0rc
2
to adapt to many kinds of systems.
\`configure' configures mpd 0.12.0rc
3
to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
...
...
@@ -1031,7 +1031,7 @@ fi
if test -n "
$
ac_init_help
"; then
case $ac_init_help in
short | recursive ) echo "
Configuration
of
mpd
0.12.0
rc
2
:
";;
short | recursive ) echo "
Configuration
of
mpd
0.12.0
rc
3
:
";;
esac
cat <<\_ACEOF
...
...
@@ -1236,7 +1236,7 @@ fi
test -n "
$
ac_init_help
" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
mpd configure 0.12.0rc
2
mpd configure 0.12.0rc
3
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
...
...
@@ -1250,7 +1250,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by mpd $as_me 0.12.0rc
2
, which was
It was created by mpd $as_me 0.12.0rc
3
, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
...
...
@@ -18799,7 +18799,7 @@ MPD_LIBS=""
MPD_CFLAGS
=
""
case
"$CC"
in
*
gcc
*)
MPD_CFLAGS
=
"-Wall"
MPD_CFLAGS
=
"-Wall
-Wmissing-prototypes
"
;;
esac
...
...
@@ -27482,7 +27482,7 @@ _ASBOX
}
>&
5
cat
>&
5
<<
_CSEOF
This
file
was
extended
by
mpd
$
as_me
0.12.0
rc
2
,
which
was
This
file
was
extended
by
mpd
$
as_me
0.12.0
rc
3
,
which
was
generated
by
GNU
Autoconf
2.59
.
Invocation
command
line
was
CONFIG_FILES
=
$
CONFIG_FILES
...
...
@@ -27545,7 +27545,7 @@ _ACEOF
cat
>>$
CONFIG_STATUS
<<
_ACEOF
ac_cs_version
=
"
\\
mpd config.status 0.12.0rc
2
mpd config.status 0.12.0rc
3
configured by $0, generated by GNU Autoconf 2.59,
with options
\\
"
`
echo
"$ac_configure_args"
|
sed
's/[\\""\`\$]/\\\\&/g'
`\\
"
...
...
configure.ac
View file @
72609e68
dnl AC_INIT(src/main.c)
dnl AM_INIT_AUTOMAKE(mpd, 0.12.0rc
2
)
dnl AM_INIT_AUTOMAKE(mpd, 0.12.0rc
3
)
AC_PREREQ(2.58)
AC_INIT(mpd, 0.12.0rc
2
, warren.dukes@gmail.com)
AC_INIT(mpd, 0.12.0rc
3
, warren.dukes@gmail.com)
AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
AC_SUBST(MPD_LIBS)
...
...
@@ -22,7 +22,7 @@ MPD_LIBS=""
MPD_CFLAGS=""
case "$CC" in
*gcc*)
MPD_CFLAGS="-Wall"
MPD_CFLAGS="-Wall
-Wmissing-prototypes
"
;;
esac
...
...
src/audio.h
View file @
72609e68
...
...
@@ -45,23 +45,23 @@ void getOutputAudioFormat(AudioFormat * inFormat, AudioFormat * outFormat);
int
parseAudioConfig
(
AudioFormat
*
audioFormat
,
char
*
conf
);
/* make sure initPlayerData is called before this function!! */
void
initAudioConfig
();
void
initAudioConfig
(
void
);
void
finishAudioConfig
();
void
finishAudioConfig
(
void
);
void
initAudioDriver
();
void
initAudioDriver
(
void
);
void
finishAudioDriver
();
void
finishAudioDriver
(
void
);
int
openAudioDevice
(
AudioFormat
*
audioFormat
);
int
playAudio
(
char
*
playChunk
,
int
size
);
void
dropBufferedAudio
();
void
dropBufferedAudio
(
void
);
void
closeAudioDevice
();
void
closeAudioDevice
(
void
);
int
isAudioDeviceOpen
();
int
isAudioDeviceOpen
(
void
);
int
isCurrentAudioFormat
(
AudioFormat
*
audioFormat
);
...
...
@@ -79,5 +79,5 @@ void readAudioDevicesState(FILE *fp);
void
saveAudioDevicesState
(
FILE
*
fp
);
void
loadAudioDrivers
();
void
loadAudioDrivers
(
void
);
#endif
src/audioOutput.h
View file @
72609e68
...
...
@@ -36,6 +36,7 @@
NULL, \
NULL, \
NULL, \
NULL \
};
typedef
struct
_AudioOutput
AudioOutput
;
...
...
@@ -95,8 +96,8 @@ typedef struct _AudioOutputPlugin {
AudioOutputSendMetadataFunc
sendMetdataFunc
;
}
AudioOutputPlugin
;
void
initAudioOutputPlugins
();
void
finishAudioOutputPlugins
();
void
initAudioOutputPlugins
(
void
);
void
finishAudioOutputPlugins
(
void
);
void
loadAudioOutputPlugin
(
AudioOutputPlugin
*
audioOutputPlugin
);
void
unloadAudioOutputPlugin
(
AudioOutputPlugin
*
audioOutputPlugin
);
...
...
src/audioOutputs/audioOutput_alsa.c
View file @
72609e68
...
...
@@ -312,7 +312,7 @@ configure_hw:
return
0
;
error:
error:
if
(
cmd
)
{
ERROR
(
"Error opening alsa device
\"
%s
\"
(%s): %s
\n
"
,
ad
->
device
,
cmd
,
snd_strerror
(
-
err
));
...
...
@@ -320,7 +320,7 @@ configure_hw:
ERROR
(
"Error opening alsa device
\"
%s
\"
: %s
\n
"
,
ad
->
device
,
snd_strerror
(
-
err
));
}
fail:
fail:
if
(
ad
->
pcmHandle
)
snd_pcm_close
(
ad
->
pcmHandle
);
ad
->
pcmHandle
=
NULL
;
...
...
src/audioOutputs/audioOutput_oss.c
View file @
72609e68
...
...
@@ -487,7 +487,7 @@ static int oss_open(AudioOutput * audioOutput)
return
0
;
fail:
fail:
oss_close
(
od
);
audioOutput
->
open
=
0
;
return
-
1
;
...
...
src/charConv.c
View file @
72609e68
...
...
@@ -41,7 +41,7 @@ mpd_sint8 char_conv_latin1ToUtf8 = 0;
#define BUFFER_SIZE 1024
static
void
closeCharSetConversion
();
static
void
closeCharSetConversion
(
void
);
int
setCharSetConversion
(
char
*
to
,
char
*
from
)
{
...
...
@@ -122,7 +122,7 @@ char *convStrDup(char *string)
iconv
(
char_conv_iconv
,
&
string
,
&
inleft
,
&
bufferPtr
,
&
outleft
);
if
(
outleft
==
BUFFER_SIZE
||
(
err
<
0
&&
errno
!=
E2BIG
))
{
||
(
err
==
-
1L
&&
errno
!=
E2BIG
))
{
free
(
ret
);
return
NULL
;
}
...
...
src/command.c
View file @
72609e68
...
...
@@ -138,7 +138,7 @@ static CommandEntry *getCommandEntryFromString(char *string, int *permission);
static
List
*
commandList
;
CommandEntry
*
newCommandEntry
(
void
)
static
CommandEntry
*
newCommandEntry
(
void
)
{
CommandEntry
*
cmd
=
malloc
(
sizeof
(
CommandEntry
));
cmd
->
cmd
=
NULL
;
...
...
src/command.h
View file @
72609e68
...
...
@@ -39,9 +39,9 @@ int processListOfCommands(int fd, int *permission, int *expired,
int
processCommand
(
int
fd
,
int
*
permission
,
char
*
commandString
);
void
initCommands
();
void
initCommands
(
void
);
void
finishCommands
();
void
finishCommands
(
void
);
#define commandSuccess(fd) fdprintf(fd, "OK\n")
...
...
src/conf.c
View file @
72609e68
...
...
@@ -89,7 +89,7 @@ static void freeConfigParam(ConfigParam * param)
free
(
param
);
}
ConfigEntry
*
newConfigEntry
(
int
repeatable
,
int
block
)
static
ConfigEntry
*
newConfigEntry
(
int
repeatable
,
int
block
)
{
ConfigEntry
*
ret
=
malloc
(
sizeof
(
ConfigEntry
));
...
...
@@ -105,7 +105,7 @@ ConfigEntry *newConfigEntry(int repeatable, int block)
return
ret
;
}
void
freeConfigEntry
(
ConfigEntry
*
entry
)
static
void
freeConfigEntry
(
ConfigEntry
*
entry
)
{
freeList
(
entry
->
configParamList
);
free
(
entry
);
...
...
src/conf.h
View file @
72609e68
...
...
@@ -73,8 +73,8 @@ typedef struct _ConfigParam {
int
numberOfBlockParams
;
}
ConfigParam
;
void
initConf
();
void
finishConf
();
void
initConf
(
void
);
void
finishConf
(
void
);
void
readConf
(
char
*
file
);
...
...
src/dbUtils.h
View file @
72609e68
...
...
@@ -61,6 +61,6 @@ unsigned long sumSongTimesIn(int fd, char *name);
int
listAllUniqueTags
(
int
fd
,
int
type
,
int
numConditiionals
,
LocateTagItem
*
conditionals
);
void
printSavedMemoryFromFilenames
();
void
printSavedMemoryFromFilenames
(
void
);
#endif
src/decode.c
View file @
72609e68
...
...
@@ -487,7 +487,7 @@ static void advanceOutputBufferTo(OutputBuffer * cb, PlayerControl * pc,
}
}
void
decodeParent
(
PlayerControl
*
pc
,
DecoderControl
*
dc
,
OutputBuffer
*
cb
)
static
void
decodeParent
(
PlayerControl
*
pc
,
DecoderControl
*
dc
,
OutputBuffer
*
cb
)
{
int
pause
=
0
;
int
quit
=
0
;
...
...
src/decode.h
View file @
72609e68
...
...
@@ -64,6 +64,6 @@ typedef struct _DecoderControl {
void
decodeSigHandler
(
int
sig
,
siginfo_t
*
siginfo
,
void
*
v
);
void
decode
();
void
decode
(
void
);
#endif
src/directory.c
View file @
72609e68
...
...
@@ -249,6 +249,11 @@ static void freeDirectoryStatFromDirectory(Directory * dir)
dir
->
stat
=
NULL
;
}
static
DirectoryList
*
newDirectoryList
(
void
)
{
return
makeList
((
ListFreeDataFunc
*
)
freeDirectory
,
1
);
}
static
Directory
*
newDirectory
(
char
*
dirname
,
Directory
*
parent
)
{
Directory
*
directory
;
...
...
@@ -279,11 +284,6 @@ static void freeDirectory(Directory * directory)
/*getDirectoryPath(NULL); */
}
static
DirectoryList
*
newDirectoryList
(
void
)
{
return
makeList
((
ListFreeDataFunc
*
)
freeDirectory
,
1
);
}
static
void
freeDirectoryList
(
DirectoryList
*
directoryList
)
{
freeList
(
directoryList
);
...
...
src/directory.h
View file @
72609e68
...
...
@@ -39,31 +39,31 @@ typedef struct _Directory {
DirectoryStat
*
stat
;
}
Directory
;
void
readDirectoryDBIfUpdateIsFinished
();
void
readDirectoryDBIfUpdateIsFinished
(
void
);
int
isUpdatingDB
();
int
isUpdatingDB
(
void
);
void
directory_sigChldHandler
(
int
pid
,
int
status
);
int
updateInit
(
int
fd
,
List
*
pathList
);
void
initMp3Directory
();
void
initMp3Directory
(
void
);
void
closeMp3Directory
();
void
closeMp3Directory
(
void
);
int
printDirectoryInfo
(
int
fd
,
char
*
dirname
);
int
checkDirectoryDB
();
int
checkDirectoryDB
(
void
);
int
writeDirectoryDB
();
int
writeDirectoryDB
(
void
);
int
readDirectoryDB
();
int
readDirectoryDB
(
void
);
void
updateMp3Directory
();
void
updateMp3Directory
(
void
);
Song
*
getSongFromDB
(
char
*
file
);
time_t
getDbModTime
();
time_t
getDbModTime
(
void
);
int
traverseAllIn
(
int
fd
,
char
*
name
,
int
(
*
forEachSong
)
(
int
,
Song
*
,
void
*
),
...
...
src/inputPlugin.h
View file @
72609e68
...
...
@@ -91,9 +91,9 @@ InputPlugin *getInputPluginFromName(char *name);
void
printAllInputPluginSuffixes
(
FILE
*
fp
);
/* this is where we "load" all the "plugins" ;-) */
void
initInputPlugins
();
void
initInputPlugins
(
void
);
/* this is where we "unload" all the "plugins" */
void
finishInputPlugins
();
void
finishInputPlugins
(
void
);
#endif
src/inputPlugins/_flac_common.c
View file @
72609e68
...
...
@@ -53,7 +53,7 @@ void init_FlacData(FlacData * data, OutputBuffer * cb,
}
static
int
flacFindVorbisCommentFloat
(
const
FLAC__StreamMetadata
*
block
,
char
*
cmnt
,
float
*
fl
)
c
onst
c
har
*
cmnt
,
float
*
fl
)
{
int
offset
=
FLAC__metadata_object_vorbiscomment_find_entry_from
(
block
,
0
,
cmnt
);
...
...
@@ -82,20 +82,20 @@ static int flacFindVorbisCommentFloat(const FLAC__StreamMetadata * block,
static
void
flacParseReplayGain
(
const
FLAC__StreamMetadata
*
block
,
FlacData
*
data
)
{
unsigned
int
found
=
0
;
int
found
=
0
;
if
(
data
->
replayGainInfo
)
freeReplayGainInfo
(
data
->
replayGainInfo
);
data
->
replayGainInfo
=
newReplayGainInfo
();
found
&
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_album_gain"
,
found
|
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_album_gain"
,
&
data
->
replayGainInfo
->
albumGain
);
found
&
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_album_peak"
,
found
|
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_album_peak"
,
&
data
->
replayGainInfo
->
albumPeak
);
found
&
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_track_gain"
,
found
|
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_track_gain"
,
&
data
->
replayGainInfo
->
trackGain
);
found
&
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_track_peak"
,
found
|
=
flacFindVorbisCommentFloat
(
block
,
"replaygain_track_peak"
,
&
data
->
replayGainInfo
->
trackPeak
);
if
(
!
found
)
{
...
...
src/inputPlugins/_ogg_common.c
View file @
72609e68
...
...
@@ -40,7 +40,7 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream)
while
(
to_read
)
{
r
=
readFromInputStream
(
inStream
,
buf
,
1
,
to_read
);
if
(
r
<
0
)
if
(
inStream
->
error
)
break
;
to_read
-=
r
;
if
(
!
r
&&
!
inputStreamAtEOF
(
inStream
))
...
...
src/inputPlugins/aac_plugin.c
View file @
72609e68
...
...
@@ -239,7 +239,7 @@ static float getAacFloatTotalTime(char *file)
unsigned
int
sampleRate
;
unsigned
char
channels
;
InputStream
inStream
;
size_t
bread
;
long
bread
;
if
(
openInputStream
(
&
inStream
,
file
)
<
0
)
return
-
1
;
...
...
@@ -291,7 +291,7 @@ static int aac_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
faacDecHandle
decoder
;
faacDecFrameInfo
frameInfo
;
faacDecConfigurationPtr
config
;
size_t
bread
;
long
bread
;
unsigned
int
sampleRate
;
unsigned
char
channels
;
int
eof
=
0
;
...
...
src/inputPlugins/flac_plugin.c
View file @
72609e68
...
...
@@ -175,7 +175,7 @@ static int flac_decode(OutputBuffer * cb, DecoderControl * dc,
dc
->
state
=
DECODE_STATE_STOP
;
dc
->
stop
=
0
;
fail:
fail:
if
(
data
.
replayGainInfo
)
freeReplayGainInfo
(
data
.
replayGainInfo
);
...
...
src/inputPlugins/mp3_plugin.c
View file @
72609e68
...
...
@@ -145,6 +145,7 @@ typedef struct _mp3DecodeData {
unsigned
long
bitRate
;
InputStream
*
inStream
;
struct
audio_dither
dither
;
enum
mad_layer
layer
;
}
mp3DecodeData
;
static
void
initMp3DecodeData
(
mp3DecodeData
*
data
,
InputStream
*
inStream
)
...
...
@@ -167,6 +168,7 @@ static void initMp3DecodeData(mp3DecodeData * data, InputStream * inStream)
data
->
decodedFirstFrame
=
0
;
data
->
flush
=
1
;
data
->
inStream
=
inStream
;
data
->
layer
=
0
;
memset
(
&
(
data
->
dither
),
0
,
sizeof
(
struct
audio_dither
));
mad_stream_init
(
&
data
->
stream
);
...
...
@@ -249,16 +251,16 @@ static ReplayGainInfo *parseId3ReplayGainInfo(struct id3_tag *tag)
id3_ucs4_latin1duplicate
(
id3_field_getstring
(
&
frame
->
fields
[
2
]));
if
(
strcmp
(
key
,
"replaygain_track_gain"
)
==
0
)
{
if
(
strc
asec
mp
(
key
,
"replaygain_track_gain"
)
==
0
)
{
replayGainInfo
->
trackGain
=
atof
(
value
);
found
=
1
;
}
else
if
(
strcmp
(
key
,
"replaygain_album_gain"
)
==
0
)
{
}
else
if
(
strc
asec
mp
(
key
,
"replaygain_album_gain"
)
==
0
)
{
replayGainInfo
->
albumGain
=
atof
(
value
);
found
=
1
;
}
else
if
(
strcmp
(
key
,
"replaygain_track_peak"
)
==
0
)
{
}
else
if
(
strc
asec
mp
(
key
,
"replaygain_track_peak"
)
==
0
)
{
replayGainInfo
->
trackPeak
=
atof
(
value
);
found
=
1
;
}
else
if
(
strcmp
(
key
,
"replaygain_album_peak"
)
==
0
)
{
}
else
if
(
strc
asec
mp
(
key
,
"replaygain_album_peak"
)
==
0
)
{
replayGainInfo
->
albumPeak
=
atof
(
value
);
found
=
1
;
}
...
...
@@ -343,7 +345,7 @@ static void mp3_parseId3Tag(mp3DecodeData * data, signed long tagsize,
}
id3_tag_delete
(
id3Tag
);
fail:
fail:
if
(
allocated
)
free
(
allocated
);
}
...
...
@@ -352,6 +354,8 @@ static void mp3_parseId3Tag(mp3DecodeData * data, signed long tagsize,
static
int
decodeNextFrameHeader
(
mp3DecodeData
*
data
,
MpdTag
**
tag
,
ReplayGainInfo
**
replayGainInfo
)
{
enum
mad_layer
layer
;
if
((
data
->
stream
).
buffer
==
NULL
||
(
data
->
stream
).
error
==
MAD_ERROR_BUFLEN
)
{
if
(
fillMp3InputBuffer
(
data
)
<
0
)
{
...
...
@@ -395,9 +399,16 @@ static int decodeNextFrameHeader(mp3DecodeData * data, MpdTag ** tag,
}
}
}
if
((
data
->
frame
.
header
.
layer
!=
MAD_LAYER_III
)
&&
(
data
->
frame
.
header
.
layer
!=
MAD_LAYER_II
)
&&
(
data
->
frame
.
header
.
layer
!=
MAD_LAYER_I
))
{
layer
=
data
->
frame
.
header
.
layer
;
if
(
!
data
->
layer
)
{
if
(
layer
!=
MAD_LAYER_II
&&
layer
!=
MAD_LAYER_III
)
{
/* Only layer 2 and 3 have been tested to work */
return
DECODE_SKIP
;
}
data
->
layer
=
layer
;
}
else
if
(
layer
!=
data
->
layer
)
{
/* Don't decode frames with a different layer than the first */
return
DECODE_SKIP
;
}
...
...
@@ -552,7 +563,7 @@ static int parse_xing(struct xing *xing, struct mad_bitptr *ptr, int *oldbitlen)
*
oldbitlen
=
bitlen
;
return
1
;
fail:
fail:
xing
->
flags
=
0
;
return
0
;
}
...
...
@@ -617,25 +628,21 @@ static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
struct
mad_bitptr
ptr
;
int
bitlen
;
int
ret
;
int
skip
;
/* stfu gcc */
memset
(
&
xing
,
0
,
sizeof
(
struct
xing
));
xing
.
flags
=
0
;
while
(
1
)
{
skip
=
0
;
while
((
ret
=
decodeNextFrameHeader
(
data
,
tag
,
replayGainInfo
))
==
DECODE_CONT
&&
(
!
dc
||
!
dc
->
stop
));
if
(
ret
==
DECODE_SKIP
)
skip
=
1
;
else
if
(
ret
==
DECODE_BREAK
||
(
dc
&&
dc
->
stop
))
return
-
1
;
if
(
ret
==
DECODE_BREAK
||
(
dc
&&
dc
->
stop
))
return
-
1
;
if
(
ret
==
DECODE_SKIP
)
continue
;
while
((
ret
=
decodeNextFrame
(
data
))
==
DECODE_CONT
&&
(
!
dc
||
!
dc
->
stop
));
if
(
ret
==
DECODE_BREAK
||
(
dc
&&
dc
->
stop
))
return
-
1
;
if
(
!
skip
&&
ret
==
DECODE_OK
)
break
;
if
(
ret
==
DECODE_OK
)
break
;
}
ptr
=
data
->
stream
.
anc_ptr
;
...
...
src/inputPlugins/oggflac_plugin.c
View file @
72609e68
...
...
@@ -306,7 +306,7 @@ static OggFLAC__SeekableStreamDecoder
return
decoder
;
fail:
fail:
oggflacPrintErroredState
(
OggFLAC__seekable_stream_decoder_get_state
(
decoder
));
OggFLAC__seekable_stream_decoder_delete
(
decoder
);
...
...
@@ -394,7 +394,7 @@ static int oggflac_decode(OutputBuffer * cb, DecoderControl * dc,
dc
->
state
=
DECODE_STATE_STOP
;
dc
->
stop
=
0
;
fail:
fail:
oggflac_cleanup
(
inStream
,
&
data
,
decoder
);
return
ret
;
...
...
src/inputPlugins/oggvorbis_plugin.c
View file @
72609e68
...
...
@@ -383,8 +383,8 @@ static MpdTag *oggvorbis_TagDup(char *file)
fp
=
fopen
(
file
,
"r"
);
if
(
!
fp
)
{
DEBUG
(
"ogg
TagDup: Failed to open file: '%s', %s
\n
"
,
file
,
strerror
(
errno
));
DEBUG
(
"ogg
vorbis_TagDup: Failed to open file: '%s', %s
\n
"
,
file
,
strerror
(
errno
));
return
NULL
;
}
if
(
ov_open
(
fp
,
&
vf
,
NULL
,
0
)
<
0
)
{
...
...
src/inputStream.h
View file @
72609e68
...
...
@@ -49,7 +49,7 @@ struct _InputStream {
char
*
metaTitle
;
};
void
initInputStream
();
void
initInputStream
(
void
);
int
isUrlSaneForInputStream
(
char
*
url
);
...
...
src/inputStream_file.h
View file @
72609e68
...
...
@@ -21,7 +21,7 @@
#include "inputStream.h"
void
inputStream_initFile
();
void
inputStream_initFile
(
void
);
int
inputStream_fileOpen
(
InputStream
*
inStream
,
char
*
filename
);
...
...
src/inputStream_http.h
View file @
72609e68
...
...
@@ -21,7 +21,7 @@
#include "inputStream.h"
void
inputStream_initHttp
();
void
inputStream_initHttp
(
void
);
int
inputStream_httpOpen
(
InputStream
*
inStream
,
char
*
filename
);
...
...
src/interface.c
View file @
72609e68
...
...
@@ -332,10 +332,10 @@ static int processLineOfInput(Interface * interface)
ERROR
(
"interface %i: command "
"list size (%i) is "
"larger than the max "
"(%i)
\n
"
,
"(%
l
i)
\n
"
,
interface
->
num
,
interface
->
cmd_list_size
,
interface_max_command_list_size
);
(
long
)
interface_max_command_list_size
);
closeInterface
(
interface
);
ret
=
COMMAND_RETURN_CLOSE
;
}
else
...
...
src/interface.h
View file @
72609e68
...
...
@@ -26,12 +26,12 @@
#include <sys/types.h>
#include <sys/socket.h>
void
initInterfaces
();
void
initInterfaces
(
void
);
void
openAInterface
(
int
fd
,
struct
sockaddr
*
addr
);
void
freeAllInterfaces
();
void
closeOldInterfaces
();
void
freeAllInterfaces
(
void
);
void
closeOldInterfaces
(
void
);
int
interfacePrintWithFD
(
int
fd
,
char
*
buffer
,
int
len
);
int
doIOForInterfaces
();
int
doIOForInterfaces
(
void
);
#endif
src/listen.h
View file @
72609e68
...
...
@@ -26,12 +26,12 @@
#include <unistd.h>
#include <sys/select.h>
void
listenOnPort
();
void
listenOnPort
(
void
);
void
getConnections
(
fd_set
*
fds
);
void
closeAllListenSockets
();
void
freeAllListenSockets
();
void
closeAllListenSockets
(
void
);
void
freeAllListenSockets
(
void
);
/* fdmax should be initialized to something */
void
addListenSocketsToFdSet
(
fd_set
*
fds
,
int
*
fdmax
);
...
...
src/log.c
View file @
72609e68
...
...
@@ -149,14 +149,14 @@ void open_log_files(const int use_stdout)
prev
=
umask
(
0066
);
param
=
parseConfigFilePath
(
CONF_LOG_FILE
,
1
);
out_filename
=
param
->
value
;
out_fd
=
x
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
out_fd
=
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
out_fd
<
0
)
FATAL
(
"problem opening log file
\"
%s
\"
(config line %i) for "
"writing
\n
"
,
param
->
value
,
param
->
line
);
param
=
parseConfigFilePath
(
CONF_ERROR_FILE
,
1
);
err_filename
=
param
->
value
;
err_fd
=
x
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
err_fd
=
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
err_fd
<
0
)
FATAL
(
"problem opening error file
\"
%s
\"
(config line %i) for "
"writing
\n
"
,
param
->
value
,
param
->
line
);
...
...
@@ -226,13 +226,13 @@ int cycle_log_files(void)
prev
=
umask
(
0066
);
out_fd
=
x
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
out_fd
=
open
(
out_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
out_fd
<
0
)
{
ERROR
(
"error re-opening log file: %s
\n
"
,
out_filename
);
return
-
1
;
}
err_fd
=
x
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
err_fd
=
open
(
err_filename
,
O_CREAT
|
O_WRONLY
|
O_APPEND
,
0666
);
if
(
err_fd
<
0
)
{
ERROR
(
"error re-opening error file: %s
\n
"
,
err_filename
);
return
-
1
;
...
...
src/log.h
View file @
72609e68
...
...
@@ -46,6 +46,6 @@ int cycle_log_files(void);
void
close_log_files
(
void
);
void
flushWarningLog
();
void
flushWarningLog
(
void
);
#endif
/* LOG_H */
src/ls.c
View file @
72609e68
...
...
@@ -224,7 +224,7 @@ char *getSuffix(char *utf8file)
return
ret
;
}
int
hasSuffix
(
char
*
utf8file
,
char
*
suffix
)
static
int
hasSuffix
(
char
*
utf8file
,
char
*
suffix
)
{
char
*
s
=
getSuffix
(
utf8file
);
if
(
s
&&
0
==
strcmp
(
s
,
suffix
))
...
...
src/mp4ff/mp4ff.c
View file @
72609e68
...
...
@@ -31,6 +31,8 @@
#include "drms.h"
int64_t
mp4ff_get_track_duration_use_offsets
(
const
mp4ff_t
*
f
,
const
int32_t
track
);
mp4ff_t
*
mp4ff_open_read
(
mp4ff_callback_t
*
f
)
{
mp4ff_t
*
ff
=
malloc
(
sizeof
(
mp4ff_t
));
...
...
@@ -202,7 +204,7 @@ int32_t mp4ff_get_decoder_config(const mp4ff_t *f, const int32_t track,
return
0
;
}
int32_t
mp4ff_get_track_type
(
const
mp4ff_t
*
f
,
const
int
track
)
static
int32_t
mp4ff_get_track_type
(
const
mp4ff_t
*
f
,
const
int
track
)
{
return
f
->
track
[
track
]
->
type
;
}
...
...
@@ -217,17 +219,17 @@ int32_t mp4ff_time_scale(const mp4ff_t *f, const int32_t track)
return
f
->
track
[
track
]
->
timeScale
;
}
uint32_t
mp4ff_get_avg_bitrate
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
static
uint32_t
mp4ff_get_avg_bitrate
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
{
return
f
->
track
[
track
]
->
avgBitrate
;
}
uint32_t
mp4ff_get_max_bitrate
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
static
uint32_t
mp4ff_get_max_bitrate
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
{
return
f
->
track
[
track
]
->
maxBitrate
;
}
int64_t
mp4ff_get_track_duration
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
static
int64_t
mp4ff_get_track_duration
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
{
return
f
->
track
[
track
]
->
duration
;
}
...
...
@@ -260,22 +262,22 @@ int32_t mp4ff_num_samples(const mp4ff_t *f, const int32_t track)
uint32_t
mp4ff_get_sample_rate
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
static
uint32_t
mp4ff_get_sample_rate
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
{
return
f
->
track
[
track
]
->
sampleRate
;
}
uint32_t
mp4ff_get_channel_count
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
static
uint32_t
mp4ff_get_channel_count
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
{
return
f
->
track
[
track
]
->
channelCount
;
}
uint32_t
mp4ff_get_audio_type
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
static
uint32_t
mp4ff_get_audio_type
(
const
mp4ff_t
*
f
,
const
int32_t
track
)
{
return
f
->
track
[
track
]
->
audioType
;
}
int32_t
mp4ff_get_sample_duration_use_offsets
(
const
mp4ff_t
*
f
,
const
int32_t
track
,
const
int32_t
sample
)
static
int32_t
mp4ff_get_sample_duration_use_offsets
(
const
mp4ff_t
*
f
,
const
int32_t
track
,
const
int32_t
sample
)
{
int32_t
d
,
o
;
d
=
mp4ff_get_sample_duration
(
f
,
track
,
sample
);
...
...
@@ -364,7 +366,7 @@ int32_t mp4ff_find_sample(const mp4ff_t *f, const int32_t track, const int64_t o
return
(
int32_t
)(
-
1
);
}
int32_t
mp4ff_find_sample_use_offsets
(
const
mp4ff_t
*
f
,
const
int32_t
track
,
const
int64_t
offset
,
int32_t
*
toskip
)
static
int32_t
mp4ff_find_sample_use_offsets
(
const
mp4ff_t
*
f
,
const
int32_t
track
,
const
int64_t
offset
,
int32_t
*
toskip
)
{
return
mp4ff_find_sample
(
f
,
track
,
offset
+
mp4ff_get_sample_offset
(
f
,
track
,
0
),
toskip
);
}
...
...
@@ -402,7 +404,7 @@ int32_t mp4ff_read_sample(mp4ff_t *f, const int32_t track, const int32_t sample,
}
int32_t
mp4ff_read_sample_v2
(
mp4ff_t
*
f
,
const
int
track
,
const
int
sample
,
unsigned
char
*
buffer
)
static
int32_t
mp4ff_read_sample_v2
(
mp4ff_t
*
f
,
const
int
track
,
const
int
sample
,
unsigned
char
*
buffer
)
{
int32_t
result
=
0
;
int32_t
size
=
mp4ff_audio_frame_size
(
f
,
track
,
sample
);
...
...
@@ -420,7 +422,7 @@ int32_t mp4ff_read_sample_v2(mp4ff_t *f, const int track, const int sample,unsig
return
result
;
}
int32_t
mp4ff_read_sample_getsize
(
mp4ff_t
*
f
,
const
int
track
,
const
int
sample
)
static
int32_t
mp4ff_read_sample_getsize
(
mp4ff_t
*
f
,
const
int
track
,
const
int
sample
)
{
int32_t
temp
=
mp4ff_audio_frame_size
(
f
,
track
,
sample
);
if
(
temp
<
0
)
temp
=
0
;
...
...
src/mp4ff/mp4tagupdate.c
View file @
72609e68
...
...
@@ -43,7 +43,7 @@ typedef struct
unsigned
error
;
}
membuffer
;
unsigned
membuffer_write
(
membuffer
*
buf
,
const
void
*
ptr
,
unsigned
bytes
)
static
unsigned
membuffer_write
(
membuffer
*
buf
,
const
void
*
ptr
,
unsigned
bytes
)
{
unsigned
dest_size
=
buf
->
written
+
bytes
;
...
...
@@ -75,64 +75,64 @@ unsigned membuffer_write(membuffer * buf,const void * ptr,unsigned bytes)
#define membuffer_write_data membuffer_write
unsigned
membuffer_write_int32
(
membuffer
*
buf
,
uint32_t
data
)
static
unsigned
membuffer_write_int32
(
membuffer
*
buf
,
uint32_t
data
)
{
uint8_t
temp
[
4
]
=
{(
uint8_t
)(
data
>>
24
),(
uint8_t
)(
data
>>
16
),(
uint8_t
)(
data
>>
8
),(
uint8_t
)
data
};
return
membuffer_write_data
(
buf
,
temp
,
4
);
}
unsigned
membuffer_write_int24
(
membuffer
*
buf
,
uint32_t
data
)
static
unsigned
membuffer_write_int24
(
membuffer
*
buf
,
uint32_t
data
)
{
uint8_t
temp
[
3
]
=
{(
uint8_t
)(
data
>>
16
),(
uint8_t
)(
data
>>
8
),(
uint8_t
)
data
};
return
membuffer_write_data
(
buf
,
temp
,
3
);
}
unsigned
membuffer_write_int16
(
membuffer
*
buf
,
uint16_t
data
)
static
unsigned
membuffer_write_int16
(
membuffer
*
buf
,
uint16_t
data
)
{
uint8_t
temp
[
2
]
=
{(
uint8_t
)(
data
>>
8
),(
uint8_t
)
data
};
return
membuffer_write_data
(
buf
,
temp
,
2
);
}
unsigned
membuffer_write_atom_name
(
membuffer
*
buf
,
const
char
*
data
)
static
unsigned
membuffer_write_atom_name
(
membuffer
*
buf
,
const
char
*
data
)
{
return
membuffer_write_data
(
buf
,
data
,
4
)
==
4
?
1
:
0
;
}
void
membuffer_write_atom
(
membuffer
*
buf
,
const
char
*
name
,
unsigned
size
,
const
void
*
data
)
static
void
membuffer_write_atom
(
membuffer
*
buf
,
const
char
*
name
,
unsigned
size
,
const
void
*
data
)
{
membuffer_write_int32
(
buf
,
size
+
8
);
membuffer_write_atom_name
(
buf
,
name
);
membuffer_write_data
(
buf
,
data
,
size
);
}
unsigned
membuffer_write_string
(
membuffer
*
buf
,
const
char
*
data
)
static
unsigned
membuffer_write_string
(
membuffer
*
buf
,
const
char
*
data
)
{
return
membuffer_write_data
(
buf
,
data
,
strlen
(
data
));
}
unsigned
membuffer_write_int8
(
membuffer
*
buf
,
uint8_t
data
)
static
unsigned
membuffer_write_int8
(
membuffer
*
buf
,
uint8_t
data
)
{
return
membuffer_write_data
(
buf
,
&
data
,
1
);
}
void
*
membuffer_get_ptr
(
const
membuffer
*
buf
)
static
void
*
membuffer_get_ptr
(
const
membuffer
*
buf
)
{
return
buf
->
data
;
}
unsigned
membuffer_get_size
(
const
membuffer
*
buf
)
static
unsigned
membuffer_get_size
(
const
membuffer
*
buf
)
{
return
buf
->
written
;
}
unsigned
membuffer_error
(
const
membuffer
*
buf
)
static
unsigned
membuffer_error
(
const
membuffer
*
buf
)
{
return
buf
->
error
;
}
void
membuffer_set_error
(
membuffer
*
buf
)
{
buf
->
error
=
1
;}
static
void
membuffer_set_error
(
membuffer
*
buf
)
{
buf
->
error
=
1
;}
unsigned
membuffer_transfer_from_file
(
membuffer
*
buf
,
mp4ff_t
*
src
,
unsigned
bytes
)
static
unsigned
membuffer_transfer_from_file
(
membuffer
*
buf
,
mp4ff_t
*
src
,
unsigned
bytes
)
{
unsigned
oldsize
;
void
*
bufptr
;
...
...
@@ -153,7 +153,7 @@ unsigned membuffer_transfer_from_file(membuffer * buf,mp4ff_t * src,unsigned byt
}
membuffer
*
membuffer_create
()
static
membuffer
*
membuffer_create
()
{
const
unsigned
initial_size
=
256
;
...
...
@@ -166,13 +166,13 @@ membuffer * membuffer_create()
return
buf
;
}
void
membuffer_free
(
membuffer
*
buf
)
static
void
membuffer_free
(
membuffer
*
buf
)
{
if
(
buf
->
data
)
free
(
buf
->
data
);
free
(
buf
);
}
void
*
membuffer_detach
(
membuffer
*
buf
)
static
void
*
membuffer_detach
(
membuffer
*
buf
)
{
void
*
ret
;
...
...
@@ -595,7 +595,7 @@ static uint32_t modify_moov(mp4ff_t * f,const mp4ff_metadata_t * data,void ** ou
}
int32_t
mp4ff_meta_update
(
mp4ff_callback_t
*
f
,
const
mp4ff_metadata_t
*
data
)
static
int32_t
mp4ff_meta_update
(
mp4ff_callback_t
*
f
,
const
mp4ff_metadata_t
*
data
)
{
void
*
new_moov_data
;
uint32_t
new_moov_size
;
...
...
src/myfprintf.c
View file @
72609e68
...
...
@@ -36,7 +36,7 @@
static
void
blockingWrite
(
const
int
fd
,
const
char
*
string
,
size_t
len
)
{
while
(
len
)
{
size_t
ret
=
xwrite
(
fd
,
string
,
len
);
s
s
ize_t
ret
=
xwrite
(
fd
,
string
,
len
);
if
(
ret
==
len
)
return
;
if
(
ret
>=
0
)
{
...
...
src/normalize.h
View file @
72609e68
...
...
@@ -23,9 +23,9 @@
extern
int
normalizationEnabled
;
void
initNormalization
();
void
initNormalization
(
void
);
void
finishNormalization
();
void
finishNormalization
(
void
);
void
normalizeData
(
char
*
buffer
,
int
bufferSize
,
AudioFormat
*
format
);
...
...
src/path.h
View file @
72609e68
...
...
@@ -25,9 +25,9 @@
extern
const
char
*
musicDir
;
void
initPaths
();
void
initPaths
(
void
);
void
finishPaths
();
void
finishPaths
(
void
);
/* utf8ToFsCharset() and fsCharsetToUtf8()
* Each returns a static pointer to a dynamically allocated buffer
...
...
@@ -44,7 +44,7 @@ char *fsCharsetToUtf8(char *str);
void
setFsCharset
(
char
*
charset
);
char
*
getFsCharset
();
char
*
getFsCharset
(
void
);
/* relative music path to absolute music path
* char * passed is a static variable, so don't free it
...
...
src/permission.h
View file @
72609e68
...
...
@@ -27,12 +27,13 @@
#define PERMISSION_CONTROL 4
#define PERMISSION_ADMIN 8
void
initPermissions
();
int
getPermissionFromPassword
(
char
*
password
,
int
*
permission
);
void
finishPermissions
();
void
finishPermissions
(
void
);
int
getDefaultPermissions
();
int
getDefaultPermissions
(
void
);
void
initPermissions
(
void
);
#endif
src/player.c
View file @
72609e68
...
...
@@ -60,7 +60,7 @@ static void resetPlayerMetadata(void)
}
}
void
resetPlayer
(
void
)
static
void
resetPlayer
(
void
)
{
int
pid
;
...
...
src/player.h
View file @
72609e68
...
...
@@ -89,7 +89,7 @@ typedef struct _PlayerControl {
MetadataChunk
fileMetadataChunk
;
}
PlayerControl
;
void
clearPlayerPid
();
void
clearPlayerPid
(
void
);
void
player_sigChldHandler
(
int
pid
,
int
status
);
...
...
@@ -101,54 +101,54 @@ int playerPause(int fd);
int
playerStop
(
int
fd
);
void
playerCloseAudio
();
void
playerCloseAudio
(
void
);
void
playerKill
();
void
playerKill
(
void
);
int
getPlayerTotalTime
();
int
getPlayerTotalTime
(
void
);
int
getPlayerElapsedTime
();
int
getPlayerElapsedTime
(
void
);
unsigned
long
getPlayerBitRate
();
unsigned
long
getPlayerBitRate
(
void
);
int
getPlayerState
();
int
getPlayerState
(
void
);
void
clearPlayerError
();
void
clearPlayerError
(
void
);
char
*
getPlayerErrorStr
();
char
*
getPlayerErrorStr
(
void
);
int
getPlayerError
();
int
getPlayerError
(
void
);
int
playerInit
();
int
playerInit
(
void
);
int
queueSong
(
Song
*
song
);
int
getPlayerQueueState
();
int
getPlayerQueueState
(
void
);
void
setQueueState
(
int
queueState
);
void
playerQueueLock
();
void
playerQueueLock
(
void
);
void
playerQueueUnlock
();
void
playerQueueUnlock
(
void
);
int
playerSeek
(
int
fd
,
Song
*
song
,
float
time
);
void
setPlayerCrossFade
(
float
crossFadeInSeconds
);
float
getPlayerCrossFade
();
float
getPlayerCrossFade
(
void
);
void
setPlayerSoftwareVolume
(
int
volume
);
double
getPlayerTotalPlayTime
();
double
getPlayerTotalPlayTime
(
void
);
unsigned
int
getPlayerSampleRate
();
unsigned
int
getPlayerSampleRate
(
void
);
int
getPlayerBits
();
int
getPlayerBits
(
void
);
int
getPlayerChannels
();
int
getPlayerChannels
(
void
);
void
playerCycleLogFiles
();
void
playerCycleLogFiles
(
void
);
Song
*
playerCurrentDecodeSong
();
Song
*
playerCurrentDecodeSong
(
void
);
#endif
src/playerData.c
View file @
72609e68
...
...
@@ -64,7 +64,7 @@ void initPlayerData(void)
buffered_chunks
=
bufferSize
/
CHUNK_SIZE
;
if
(
buffered_chunks
>=
1
<<
15
)
{
ERROR
(
"buffer size
\"
%
i
\"
is too big
\n
"
,
bufferSize
);
ERROR
(
"buffer size
\"
%
li
\"
is too big
\n
"
,
(
long
)
bufferSize
);
exit
(
EXIT_FAILURE
);
}
...
...
src/playerData.h
View file @
72609e68
...
...
@@ -40,10 +40,10 @@ typedef struct _PlayerData {
mpd_uint8
*
audioDeviceStates
;
}
PlayerData
;
void
initPlayerData
();
void
initPlayerData
(
void
);
PlayerData
*
getPlayerData
();
PlayerData
*
getPlayerData
(
void
);
void
freePlayerData
();
void
freePlayerData
(
void
);
#endif
src/playlist.c
View file @
72609e68
...
...
@@ -385,7 +385,7 @@ void readPlaylistState(FILE *fp)
}
}
void
printPlaylistSongInfo
(
int
fd
,
int
song
)
static
void
printPlaylistSongInfo
(
int
fd
,
int
song
)
{
printSongInfo
(
fd
,
playlist
.
songs
[
song
]);
fdprintf
(
fd
,
"Pos: %i
\n
Id: %i
\n
"
,
song
,
playlist
.
positionToId
[
song
]);
...
...
@@ -472,7 +472,7 @@ int playlistId(int fd, int id)
return
0
;
}
void
swapSongs
(
int
song1
,
int
song2
)
static
void
swapSongs
(
int
song1
,
int
song2
)
{
Song
*
sTemp
;
int
iTemp
;
...
...
@@ -492,7 +492,7 @@ void swapSongs(int song1, int song2)
playlist
.
positionToId
[
song2
]
=
iTemp
;
}
void
queueNextSongInPlaylist
(
void
)
static
void
queueNextSongInPlaylist
(
void
)
{
if
(
playlist
.
current
<
playlist
.
length
-
1
)
{
playlist
.
queued
=
playlist
.
current
+
1
;
...
...
@@ -522,7 +522,7 @@ void queueNextSongInPlaylist(void)
}
}
void
syncPlaylistWithQueue
(
int
queue
)
static
void
syncPlaylistWithQueue
(
int
queue
)
{
if
(
queue
&&
getPlayerQueueState
()
==
PLAYER_QUEUE_BLANK
)
{
queueNextSongInPlaylist
();
...
...
@@ -543,7 +543,7 @@ void syncPlaylistWithQueue(int queue)
}
}
void
lockPlaylistInteraction
(
void
)
static
void
lockPlaylistInteraction
(
void
)
{
if
(
getPlayerQueueState
()
==
PLAYER_QUEUE_PLAY
||
getPlayerQueueState
()
==
PLAYER_QUEUE_FULL
)
{
...
...
@@ -557,7 +557,7 @@ static void unlockPlaylistInteraction(void)
playerQueueUnlock
();
}
void
clearPlayerQueue
(
void
)
static
void
clearPlayerQueue
(
void
)
{
playlist
.
queued
=
-
1
;
switch
(
getPlayerQueueState
())
{
...
...
@@ -901,7 +901,7 @@ int playPlaylistById(int fd, int id, int stopOnError)
return
playPlaylist
(
fd
,
playlist
.
idToPosition
[
id
],
stopOnError
);
}
void
syncCurrentPlayerDecodeMetadata
(
void
)
static
void
syncCurrentPlayerDecodeMetadata
(
void
)
{
Song
*
songPlayer
=
playerCurrentDecodeSong
();
Song
*
song
;
...
...
@@ -940,7 +940,7 @@ void syncPlayerAndPlaylist(void)
syncCurrentPlayerDecodeMetadata
();
}
int
currentSongInPlaylist
(
int
fd
)
static
int
currentSongInPlaylist
(
int
fd
)
{
if
(
playlist_state
!=
PLAYLIST_STATE_PLAY
)
return
0
;
...
...
src/playlist.h
View file @
72609e68
...
...
@@ -30,9 +30,9 @@
#define PLAYLIST_FILE_SUFFIX "m3u"
void
initPlaylist
();
void
initPlaylist
(
void
);
void
finishPlaylist
();
void
finishPlaylist
(
void
);
void
readPlaylistState
(
FILE
*
);
...
...
@@ -62,7 +62,7 @@ int playPlaylistById(int fd, int song, int stopOnError);
int
nextSongInPlaylist
(
int
fd
);
void
syncPlayerAndPlaylist
();
void
syncPlayerAndPlaylist
(
void
);
int
previousSongInPlaylist
(
int
fd
);
...
...
@@ -86,29 +86,29 @@ int swapSongsInPlaylistById(int fd, int id1, int id2);
int
loadPlaylist
(
int
fd
,
char
*
utf8file
);
int
getPlaylistRepeatStatus
();
int
getPlaylistRepeatStatus
(
void
);
int
setPlaylistRepeatStatus
(
int
fd
,
int
status
);
int
getPlaylistRandomStatus
();
int
getPlaylistRandomStatus
(
void
);
int
setPlaylistRandomStatus
(
int
fd
,
int
status
);
int
getPlaylistCurrentSong
();
int
getPlaylistCurrentSong
(
void
);
int
getPlaylistSongId
(
int
song
);
int
getPlaylistLength
();
int
getPlaylistLength
(
void
);
unsigned
long
getPlaylistVersion
();
unsigned
long
getPlaylistVersion
(
void
);
void
playPlaylistIfPlayerStopped
();
void
playPlaylistIfPlayerStopped
(
void
);
int
seekSongInPlaylist
(
int
fd
,
int
song
,
float
time
);
int
seekSongInPlaylistById
(
int
fd
,
int
id
,
float
time
);
void
playlistVersionChange
();
void
playlistVersionChange
(
void
);
int
playlistChanges
(
int
fd
,
mpd_uint32
version
);
...
...
src/replayGain.h
View file @
72609e68
...
...
@@ -38,11 +38,11 @@ typedef struct _ReplayGainInfo {
float
scale
;
}
ReplayGainInfo
;
ReplayGainInfo
*
newReplayGainInfo
();
ReplayGainInfo
*
newReplayGainInfo
(
void
);
void
freeReplayGainInfo
(
ReplayGainInfo
*
info
);
void
initReplayGainState
();
void
initReplayGainState
(
void
);
void
doReplayGain
(
ReplayGainInfo
*
info
,
char
*
buffer
,
int
bufferSize
,
AudioFormat
*
format
);
...
...
src/sig_handlers.c
View file @
72609e68
...
...
@@ -58,7 +58,7 @@ int handlePendingSignals(void)
return
0
;
}
void
chldSigHandler
(
int
signal
)
static
void
chldSigHandler
(
int
signal
)
{
int
status
;
int
pid
;
...
...
src/sig_handlers.h
View file @
72609e68
...
...
@@ -21,22 +21,22 @@
#include "../config.h"
int
handlePendingSignals
();
int
handlePendingSignals
(
void
);
void
initSigHandlers
();
void
initSigHandlers
(
void
);
void
finishSigHandlers
();
void
finishSigHandlers
(
void
);
void
setSigHandlersForDecoder
();
void
setSigHandlersForDecoder
(
void
);
void
ignoreSignals
();
void
ignoreSignals
(
void
);
void
blockSignals
();
void
blockSignals
(
void
);
void
unblockSignals
();
void
unblockSignals
(
void
);
void
blockTermSignal
();
void
blockTermSignal
(
void
);
void
unblockTermSignal
();
void
unblockTermSignal
(
void
);
#endif
src/song.h
View file @
72609e68
...
...
@@ -43,7 +43,7 @@ typedef struct _Song {
typedef
List
SongList
;
Song
*
newNullSong
();
Song
*
newNullSong
(
void
);
Song
*
newSong
(
char
*
url
,
int
songType
,
struct
_Directory
*
parentDir
);
...
...
@@ -51,7 +51,7 @@ void freeSong(Song *);
void
freeJustSong
(
Song
*
);
SongList
*
newSongList
();
SongList
*
newSongList
(
void
);
void
freeSongList
(
SongList
*
list
);
...
...
src/stats.h
View file @
72609e68
...
...
@@ -33,7 +33,7 @@ typedef struct _Stats {
extern
Stats
stats
;
void
initStats
();
void
initStats
(
void
);
int
printStats
(
int
fd
);
...
...
src/tag.h
View file @
72609e68
...
...
@@ -65,9 +65,9 @@ MpdTag *apeDup(char *file);
MpdTag
*
id3Dup
(
char
*
file
);
MpdTag
*
newMpdTag
();
MpdTag
*
newMpdTag
(
void
);
void
initTagConfig
();
void
initTagConfig
(
void
);
void
clearItemsFromMpdTag
(
MpdTag
*
tag
,
int
itemType
);
...
...
src/tree.c
View file @
72609e68
...
...
@@ -350,8 +350,7 @@ _MergeNodes(TreeNode * lessNode, TreeNode * moreNode)
free
(
moreNode
);
}
void
_DeleteAt
(
TreeIterator
*
iter
)
static
void
_DeleteAt
(
TreeIterator
*
iter
)
{
TreeNode
*
node
=
iter
->
node
;
int
pos
=
iter
->
which
-
1
;
...
...
src/utils.h
View file @
72609e68
...
...
@@ -39,20 +39,13 @@ void stripReturnChar(char *string);
void
my_usleep
(
long
usec
);
int
ipv6Supported
();
int
ipv6Supported
(
void
);
char
*
appendToString
(
char
*
dest
,
const
char
*
src
);
unsigned
long
readLEuint32
(
const
unsigned
char
*
p
);
/* trivial functions, keep them inlined */
static
inline
int
xopen
(
const
char
*
path
,
int
flags
,
mode_t
mode
)
{
int
fd
;
while
(
0
>
(
fd
=
open
(
path
,
flags
,
mode
))
&&
errno
==
EINTR
);
return
fd
;
}
static
inline
void
xclose
(
int
fd
)
{
while
(
close
(
fd
)
&&
errno
==
EINTR
);
...
...
src/volume.h
View file @
72609e68
...
...
@@ -27,13 +27,13 @@
#define VOLUME_MIXER_ALSA "alsa"
#define VOLUME_MIXER_SOFTWARE "software"
void
initVolume
();
void
initVolume
(
void
);
void
openVolumeDevice
();
void
openVolumeDevice
(
void
);
void
finishVolume
();
void
finishVolume
(
void
);
int
getVolumeLevel
();
int
getVolumeLevel
(
void
);
int
changeVolumeLevel
(
int
fd
,
int
change
,
int
rel
);
...
...
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