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
3cf54591
Commit
3cf54591
authored
Nov 04, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wavpack: use the bool data type
Use boolean true/false instead of 1/0.
parent
b6ea410c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
wavpack_plugin.c
src/decoder/wavpack_plugin.c
+12
-12
No files found.
src/decoder/wavpack_plugin.c
View file @
3cf54591
...
@@ -126,7 +126,7 @@ static void format_samples_float(mpd_unused int bytes_per_sample, void *buffer,
...
@@ -126,7 +126,7 @@ static void format_samples_float(mpd_unused int bytes_per_sample, void *buffer,
* Requires an already opened WavpackContext.
* Requires an already opened WavpackContext.
*/
*/
static
void
wavpack_decode
(
struct
decoder
*
decoder
,
static
void
wavpack_decode
(
struct
decoder
*
decoder
,
WavpackContext
*
wpc
,
int
canseek
,
WavpackContext
*
wpc
,
bool
canseek
,
ReplayGainInfo
*
replayGainInfo
)
ReplayGainInfo
*
replayGainInfo
)
{
{
struct
audio_format
audio_format
;
struct
audio_format
audio_format
;
...
@@ -430,8 +430,8 @@ static bool wavpack_trydecode(struct input_stream *is)
...
@@ -430,8 +430,8 @@ static bool wavpack_trydecode(struct input_stream *is)
return
true
;
return
true
;
}
}
static
int
wavpack_open_wvc
(
struct
decoder
*
decoder
,
static
bool
struct
input_stream
*
is_wvc
)
wavpack_open_wvc
(
struct
decoder
*
decoder
,
struct
input_stream
*
is_wvc
)
{
{
char
tmp
[
MPD_PATH_MAX
];
char
tmp
[
MPD_PATH_MAX
];
const
char
*
utf8url
;
const
char
*
utf8url
;
...
@@ -445,15 +445,15 @@ static int wavpack_open_wvc(struct decoder *decoder,
...
@@ -445,15 +445,15 @@ static int wavpack_open_wvc(struct decoder *decoder,
*/
*/
utf8url
=
decoder_get_url
(
decoder
,
tmp
);
utf8url
=
decoder_get_url
(
decoder
,
tmp
);
if
(
utf8url
==
NULL
)
if
(
utf8url
==
NULL
)
return
0
;
return
false
;
len
=
strlen
(
utf8url
);
len
=
strlen
(
utf8url
);
if
(
!
len
)
if
(
!
len
)
return
0
;
return
false
;
wvc_url
=
(
char
*
)
xmalloc
(
len
+
2
);
/* +2: 'c' and EOS */
wvc_url
=
(
char
*
)
xmalloc
(
len
+
2
);
/* +2: 'c' and EOS */
if
(
wvc_url
==
NULL
)
if
(
wvc_url
==
NULL
)
return
0
;
return
false
;
memcpy
(
wvc_url
,
utf8url
,
len
);
memcpy
(
wvc_url
,
utf8url
,
len
);
wvc_url
[
len
]
=
'c'
;
wvc_url
[
len
]
=
'c'
;
...
@@ -463,7 +463,7 @@ static int wavpack_open_wvc(struct decoder *decoder,
...
@@ -463,7 +463,7 @@ static int wavpack_open_wvc(struct decoder *decoder,
free
(
wvc_url
);
free
(
wvc_url
);
if
(
!
ret
)
if
(
!
ret
)
return
0
;
return
false
;
/*
/*
* And we try to buffer in order to get know
* And we try to buffer in order to get know
...
@@ -477,15 +477,15 @@ static int wavpack_open_wvc(struct decoder *decoder,
...
@@ -477,15 +477,15 @@ static int wavpack_open_wvc(struct decoder *decoder,
* So, this is not good :/
* So, this is not good :/
*/
*/
input_stream_close
(
is_wvc
);
input_stream_close
(
is_wvc
);
return
0
;
return
false
;
}
}
if
(
input_stream_buffer
(
is_wvc
)
>=
0
)
if
(
input_stream_buffer
(
is_wvc
)
>=
0
)
return
1
;
return
true
;
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_NONE
)
{
if
(
decoder_get_command
(
decoder
)
!=
DECODE_COMMAND_NONE
)
{
input_stream_close
(
is_wvc
);
input_stream_close
(
is_wvc
);
return
0
;
return
false
;
}
}
/* Save some CPU */
/* Save some CPU */
...
@@ -519,7 +519,7 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
...
@@ -519,7 +519,7 @@ wavpack_streamdecode(struct decoder * decoder, struct input_stream *is)
return
false
;
return
false
;
}
}
wavpack_decode
(
decoder
,
wpc
,
can_seek
(
&
isp
)
,
NULL
);
wavpack_decode
(
decoder
,
wpc
,
is
->
seekable
,
NULL
);
WavpackCloseFile
(
wpc
);
WavpackCloseFile
(
wpc
);
if
(
open_flags
&
OPEN_WVC
)
if
(
open_flags
&
OPEN_WVC
)
...
@@ -549,7 +549,7 @@ wavpack_filedecode(struct decoder *decoder, const char *fname)
...
@@ -549,7 +549,7 @@ wavpack_filedecode(struct decoder *decoder, const char *fname)
replay_gain_info
=
wavpack_replaygain
(
wpc
);
replay_gain_info
=
wavpack_replaygain
(
wpc
);
wavpack_decode
(
decoder
,
wpc
,
1
,
replay_gain_info
);
wavpack_decode
(
decoder
,
wpc
,
true
,
replay_gain_info
);
if
(
replay_gain_info
)
if
(
replay_gain_info
)
freeReplayGainInfo
(
replay_gain_info
);
freeReplayGainInfo
(
replay_gain_info
);
...
...
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