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
bf6258f5
Commit
bf6258f5
authored
Dec 14, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/run_{decoder,filter}: implemented GLib log callback
Log to stderr, not to stdout (which broke PCM output).
parent
8587fcbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
run_decoder.c
test/run_decoder.c
+12
-0
run_filter.c
test/run_filter.c
+13
-0
No files found.
test/run_decoder.c
View file @
bf6258f5
...
@@ -30,6 +30,16 @@
...
@@ -30,6 +30,16 @@
#include <assert.h>
#include <assert.h>
#include <unistd.h>
#include <unistd.h>
static
void
my_log_func
(
const
gchar
*
log_domain
,
G_GNUC_UNUSED
GLogLevelFlags
log_level
,
const
gchar
*
message
,
G_GNUC_UNUSED
gpointer
user_data
)
{
if
(
log_domain
!=
NULL
)
g_printerr
(
"%s: %s
\n
"
,
log_domain
,
message
);
else
g_printerr
(
"%s
\n
"
,
message
);
}
/**
/**
* No-op dummy.
* No-op dummy.
*/
*/
...
@@ -139,6 +149,8 @@ int main(int argc, char **argv)
...
@@ -139,6 +149,8 @@ int main(int argc, char **argv)
decoder_name
=
argv
[
1
];
decoder_name
=
argv
[
1
];
decoder
.
uri
=
argv
[
2
];
decoder
.
uri
=
argv
[
2
];
g_log_set_default_handler
(
my_log_func
,
NULL
);
input_stream_global_init
();
input_stream_global_init
();
decoder_plugin_init_all
();
decoder_plugin_init_all
();
...
...
test/run_filter.c
View file @
bf6258f5
...
@@ -31,6 +31,16 @@
...
@@ -31,6 +31,16 @@
#include <errno.h>
#include <errno.h>
#include <unistd.h>
#include <unistd.h>
static
void
my_log_func
(
const
gchar
*
log_domain
,
G_GNUC_UNUSED
GLogLevelFlags
log_level
,
const
gchar
*
message
,
G_GNUC_UNUSED
gpointer
user_data
)
{
if
(
log_domain
!=
NULL
)
g_printerr
(
"%s: %s
\n
"
,
log_domain
,
message
);
else
g_printerr
(
"%s
\n
"
,
message
);
}
static
const
struct
config_param
*
static
const
struct
config_param
*
find_named_config_block
(
const
char
*
block
,
const
char
*
name
)
find_named_config_block
(
const
char
*
block
,
const
char
*
name
)
{
{
...
@@ -87,7 +97,10 @@ int main(int argc, char **argv)
...
@@ -87,7 +97,10 @@ int main(int argc, char **argv)
audio_format_init
(
&
audio_format
,
44100
,
SAMPLE_FORMAT_S16
,
2
);
audio_format_init
(
&
audio_format
,
44100
,
SAMPLE_FORMAT_S16
,
2
);
/* initialize GLib */
g_thread_init
(
NULL
);
g_thread_init
(
NULL
);
g_log_set_default_handler
(
my_log_func
,
NULL
);
/* read configuration file (mpd.conf) */
/* read configuration file (mpd.conf) */
...
...
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