summaryrefslogtreecommitdiffstats
path: root/polyp/sound-file.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-09-05 00:03:16 +0000
committerLennart Poettering <lennart@poettering.net>2004-09-05 00:03:16 +0000
commit6c4fd620408b3f14a1d4164d58db70df7a252674 (patch)
tree3767a0fb76a3941267f9b6980075149dc31cb6bc /polyp/sound-file.c
parent57e473b61cf373f8d9befb03d359b999eca4262b (diff)
implement proper logging
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@179 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/sound-file.c')
-rw-r--r--polyp/sound-file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/polyp/sound-file.c b/polyp/sound-file.c
index 01fda78e..d1f7e0f7 100644
--- a/polyp/sound-file.c
+++ b/polyp/sound-file.c
@@ -30,6 +30,7 @@
#include "sound-file.h"
#include "sample.h"
+#include "log.h"
#define MAX_FILE_SIZE (1024*1024)
@@ -46,7 +47,7 @@ int pa_sound_file_load(const char *fname, struct pa_sample_spec *ss, struct pa_m
chunk->index = chunk->length = 0;
if (!(sf = sf_open(fname, SFM_READ, &sfinfo))) {
- fprintf(stderr, __FILE__": Failed to open file %s\n", fname);
+ pa_log(__FILE__": Failed to open file %s\n", fname);
goto finish;
}
@@ -55,12 +56,12 @@ int pa_sound_file_load(const char *fname, struct pa_sample_spec *ss, struct pa_m
ss->channels = sfinfo.channels;
if (!pa_sample_spec_valid(ss)) {
- fprintf(stderr, __FILE__": Unsupported sample format in file %s\n", fname);
+ pa_log(__FILE__": Unsupported sample format in file %s\n", fname);
goto finish;
}
if ((l = pa_frame_size(ss)*sfinfo.frames) > MAX_FILE_SIZE) {
- fprintf(stderr, __FILE__": File to large\n");
+ pa_log(__FILE__": File to large\n");
goto finish;
}
@@ -70,7 +71,7 @@ int pa_sound_file_load(const char *fname, struct pa_sample_spec *ss, struct pa_m
chunk->length = l;
if (sf_readf_float(sf, chunk->memblock->data, sfinfo.frames) != sfinfo.frames) {
- fprintf(stderr, __FILE__": Premature file end\n");
+ pa_log(__FILE__": Premature file end\n");
goto finish;
}