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
a6fecd6c
Commit
a6fecd6c
authored
Jun 03, 2007
by
J. Alexander Treuman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making some bool options more consistent.
git-svn-id:
https://svn.musicpd.org/mpd/trunk@6468
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
d67737bc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
14 deletions
+29
-14
mp3_plugin.c
src/inputPlugins/mp3_plugin.c
+7
-5
normalize.c
src/normalize.c
+6
-2
playlist.c
src/playlist.c
+4
-2
zeroconf.c
src/zeroconf.c
+12
-5
No files found.
src/inputPlugins/mp3_plugin.c
View file @
a6fecd6c
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
#define DEFAULT_GAPLESS_MP3_PLAYBACK 1
#define DEFAULT_GAPLESS_MP3_PLAYBACK 1
static
int
gaplessPlayback
;
static
int
gaplessPlayback
Enabled
;
/* this is stolen from mpg321! */
/* this is stolen from mpg321! */
struct
audio_dither
{
struct
audio_dither
{
...
@@ -120,9 +120,11 @@ static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample,
...
@@ -120,9 +120,11 @@ static signed long audio_linear_dither(unsigned int bits, mad_fixed_t sample,
static
int
mp3_plugin_init
(
void
)
static
int
mp3_plugin_init
(
void
)
{
{
gaplessPlayback
=
getBoolConfigParam
(
CONF_GAPLESS_MP3_PLAYBACK
);
gaplessPlaybackEnabled
=
getBoolConfigParam
(
CONF_GAPLESS_MP3_PLAYBACK
);
if
(
gaplessPlayback
==
-
1
)
gaplessPlayback
=
DEFAULT_GAPLESS_MP3_PLAYBACK
;
if
(
gaplessPlaybackEnabled
==
-
1
)
else
if
(
gaplessPlayback
<
0
)
exit
(
EXIT_FAILURE
);
gaplessPlaybackEnabled
=
DEFAULT_GAPLESS_MP3_PLAYBACK
;
else
if
(
gaplessPlaybackEnabled
<
0
)
exit
(
EXIT_FAILURE
);
return
1
;
return
1
;
}
}
...
@@ -692,7 +694,7 @@ static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
...
@@ -692,7 +694,7 @@ static int decodeFirstFrame(mp3DecodeData * data, DecoderControl * dc,
data
->
foundXing
=
1
;
data
->
foundXing
=
1
;
data
->
muteFrame
=
MUTEFRAME_SKIP
;
data
->
muteFrame
=
MUTEFRAME_SKIP
;
if
(
gaplessPlayback
&&
data
->
inStream
->
seekable
&&
if
(
gaplessPlayback
Enabled
&&
data
->
inStream
->
seekable
&&
parse_lame
(
&
lame
,
&
ptr
,
&
bitlen
))
{
parse_lame
(
&
lame
,
&
ptr
,
&
bitlen
))
{
data
->
dropSamplesAtStart
=
lame
.
encoderDelay
+
DECODERDELAY
;
data
->
dropSamplesAtStart
=
lame
.
encoderDelay
+
DECODERDELAY
;
data
->
dropSamplesAtEnd
=
lame
.
encoderPadding
;
data
->
dropSamplesAtEnd
=
lame
.
encoderPadding
;
...
...
src/normalize.c
View file @
a6fecd6c
...
@@ -22,13 +22,17 @@
...
@@ -22,13 +22,17 @@
#include <stdlib.h>
#include <stdlib.h>
#define DEFAULT_VOLUME_NORMALIZATION 0
int
normalizationEnabled
;
int
normalizationEnabled
;
void
initNormalization
(
void
)
void
initNormalization
(
void
)
{
{
normalizationEnabled
=
getBoolConfigParam
(
CONF_VOLUME_NORMALIZATION
);
normalizationEnabled
=
getBoolConfigParam
(
CONF_VOLUME_NORMALIZATION
);
if
(
normalizationEnabled
==
-
1
)
normalizationEnabled
=
0
;
if
(
normalizationEnabled
==
-
1
)
else
if
(
normalizationEnabled
<
0
)
exit
(
EXIT_FAILURE
);
normalizationEnabled
=
DEFAULT_VOLUME_NORMALIZATION
;
else
if
(
normalizationEnabled
<
0
)
exit
(
EXIT_FAILURE
);
if
(
normalizationEnabled
)
if
(
normalizationEnabled
)
CompressCfg
(
0
,
ANTICLIP
,
TARGET
,
GAINMAX
,
GAINSMOOTH
,
BUCKETS
);
CompressCfg
(
0
,
ANTICLIP
,
TARGET
,
GAINMAX
,
GAINSMOOTH
,
BUCKETS
);
...
...
src/playlist.c
View file @
a6fecd6c
...
@@ -141,8 +141,10 @@ void initPlaylist(void)
...
@@ -141,8 +141,10 @@ void initPlaylist(void)
}
}
playlist_saveAbsolutePaths
=
getBoolConfigParam
(
CONF_SAVE_ABSOLUTE_PATHS
);
playlist_saveAbsolutePaths
=
getBoolConfigParam
(
CONF_SAVE_ABSOLUTE_PATHS
);
if
(
playlist_saveAbsolutePaths
==
-
1
)
playlist_saveAbsolutePaths
=
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS
;
if
(
playlist_saveAbsolutePaths
==
-
1
)
else
if
(
playlist_saveAbsolutePaths
<
0
)
exit
(
EXIT_FAILURE
);
playlist_saveAbsolutePaths
=
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS
;
else
if
(
playlist_saveAbsolutePaths
<
0
)
exit
(
EXIT_FAILURE
);
playlist
.
songs
=
xmalloc
(
sizeof
(
Song
*
)
*
playlist_max_length
);
playlist
.
songs
=
xmalloc
(
sizeof
(
Song
*
)
*
playlist_max_length
);
playlist
.
songMod
=
xmalloc
(
sizeof
(
mpd_uint32
)
*
playlist_max_length
);
playlist
.
songMod
=
xmalloc
(
sizeof
(
mpd_uint32
)
*
playlist_max_length
);
...
...
src/zeroconf.c
View file @
a6fecd6c
...
@@ -36,6 +36,10 @@
...
@@ -36,6 +36,10 @@
*/
*/
#define SERVICE_NAME "Music Player"
#define SERVICE_NAME "Music Player"
#define DEFAULT_ZEROCONF_ENABLED 1
static
zeroconfEnabled
;
static
struct
ioOps
zeroConfIo
=
{
static
struct
ioOps
zeroConfIo
=
{
};
};
...
@@ -549,9 +553,14 @@ void initZeroconf(void)
...
@@ -549,9 +553,14 @@ void initZeroconf(void)
{
{
const
char
*
serviceName
=
SERVICE_NAME
;
const
char
*
serviceName
=
SERVICE_NAME
;
ConfigParam
*
param
;
ConfigParam
*
param
;
int
enabled
=
getBoolConfigParam
(
CONF_ZEROCONF_ENABLED
);
if
(
enabled
!=
-
1
&&
enabled
!=
1
)
zeroconfEnabled
=
getBoolConfigParam
(
CONF_ZEROCONF_ENABLED
);
if
(
enabled
==
-
1
)
zeroconfEnabled
=
DEFAULT_ZEROCONF_ENABLED
;
else
if
(
enabled
<
0
)
exit
(
EXIT_FAILURE
);
if
(
!
zeroconfEnabled
)
return
;
return
;
param
=
getConfigParam
(
CONF_ZEROCONF_NAME
);
param
=
getConfigParam
(
CONF_ZEROCONF_NAME
);
...
@@ -570,9 +579,7 @@ void initZeroconf(void)
...
@@ -570,9 +579,7 @@ void initZeroconf(void)
void
finishZeroconf
(
void
)
void
finishZeroconf
(
void
)
{
{
int
enabled
=
getBoolConfigParam
(
CONF_ZEROCONF_ENABLED
);
if
(
!
zeroconfEnabled
)
if
(
enabled
!=
-
1
&&
enabled
!=
1
)
return
;
return
;
#ifdef HAVE_AVAHI
#ifdef HAVE_AVAHI
...
...
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