Commit 7a2fe930 authored by Max Kellermann's avatar Max Kellermann

aac: use GLib instead of utils.h/log.h

Removed the superfluous my_usleep() call.
parent 0243e1e2
...@@ -20,11 +20,13 @@ ...@@ -20,11 +20,13 @@
#define AAC_MAX_CHANNELS 6 #define AAC_MAX_CHANNELS 6
#include "../utils.h"
#include "../log.h"
#include <assert.h> #include <assert.h>
#include <unistd.h>
#include <faad.h> #include <faad.h>
#include <glib.h>
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "aac"
/* all code here is either based on or copied from FAAD2's frontend code */ /* all code here is either based on or copied from FAAD2's frontend code */
typedef struct { typedef struct {
...@@ -354,7 +356,6 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) ...@@ -354,7 +356,6 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
fillAacBuffer(&b); fillAacBuffer(&b);
adts_find_frame(&b); adts_find_frame(&b);
fillAacBuffer(&b); fillAacBuffer(&b);
my_usleep(10000);
} }
#ifdef HAVE_FAAD_BUFLEN_FUNCS #ifdef HAVE_FAAD_BUFLEN_FUNCS
...@@ -364,7 +365,7 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) ...@@ -364,7 +365,7 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
bread = faacDecInit(decoder, b.buffer, sample_rate_r, &channels); bread = faacDecInit(decoder, b.buffer, sample_rate_r, &channels);
#endif #endif
if (bread < 0) { if (bread < 0) {
ERROR("Error not a AAC stream.\n"); g_warning("Error not a AAC stream.\n");
faacDecClose(decoder); faacDecClose(decoder);
return; return;
} }
...@@ -389,9 +390,8 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream) ...@@ -389,9 +390,8 @@ aac_stream_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
#endif #endif
if (frameInfo.error > 0) { if (frameInfo.error > 0) {
ERROR("error decoding AAC stream\n"); g_warning("error decoding AAC stream: %s\n",
ERROR("faad2 error: %s\n", faacDecGetErrorMessage(frameInfo.error));
faacDecGetErrorMessage(frameInfo.error));
break; break;
} }
#ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE #ifdef HAVE_FAACDECFRAMEINFO_SAMPLERATE
...@@ -445,8 +445,8 @@ static struct tag *aacTagDup(const char *file) ...@@ -445,8 +445,8 @@ static struct tag *aacTagDup(const char *file)
ret = tag_new(); ret = tag_new();
ret->time = file_time; ret->time = file_time;
} else { } else {
DEBUG("aacTagDup: Failed to get total song time from: %s\n", g_debug("aacTagDup: Failed to get total song time from: %s\n",
file); file);
} }
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment