mpc: use GLib instead of utils.h/log.h
Don't use deprecated MPD libraries.
This commit is contained in:
parent
1414a3de4c
commit
865757835e
@ -17,10 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../decoder_api.h"
|
#include "../decoder_api.h"
|
||||||
#include "../utils.h"
|
|
||||||
#include "../log.h"
|
|
||||||
|
|
||||||
#include <mpcdec/mpcdec.h>
|
#include <mpcdec/mpcdec.h>
|
||||||
|
#include <glib.h>
|
||||||
|
|
||||||
typedef struct _MpcCallbackData {
|
typedef struct _MpcCallbackData {
|
||||||
struct input_stream *inStream;
|
struct input_stream *inStream;
|
||||||
@ -135,7 +134,7 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
|
|||||||
|
|
||||||
if ((ret = mpc_streaminfo_read(&info, &reader)) != ERROR_CODE_OK) {
|
if ((ret = mpc_streaminfo_read(&info, &reader)) != ERROR_CODE_OK) {
|
||||||
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP)
|
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP)
|
||||||
ERROR("Not a valid musepack stream\n");
|
g_warning("Not a valid musepack stream\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +142,7 @@ mpc_decode(struct decoder *mpd_decoder, struct input_stream *inStream)
|
|||||||
|
|
||||||
if (!mpc_decoder_initialize(&decoder, &info)) {
|
if (!mpc_decoder_initialize(&decoder, &info)) {
|
||||||
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP)
|
if (decoder_get_command(mpd_decoder) != DECODE_COMMAND_STOP)
|
||||||
ERROR("Not a valid musepack stream\n");
|
g_warning("Not a valid musepack stream\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,10 +245,8 @@ static float mpcGetTime(const char *file)
|
|||||||
|
|
||||||
mpc_streaminfo_init(&info);
|
mpc_streaminfo_init(&info);
|
||||||
|
|
||||||
if (!input_stream_open(&inStream, file)) {
|
if (!input_stream_open(&inStream, file))
|
||||||
DEBUG("mpcGetTime: Failed to open file: %s\n", file);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
|
if (mpc_streaminfo_read(&info, &reader) != ERROR_CODE_OK) {
|
||||||
input_stream_close(&inStream);
|
input_stream_close(&inStream);
|
||||||
@ -269,8 +266,8 @@ static struct tag *mpcTagDup(const char *file)
|
|||||||
float total_time = mpcGetTime(file);
|
float total_time = mpcGetTime(file);
|
||||||
|
|
||||||
if (total_time < 0) {
|
if (total_time < 0) {
|
||||||
DEBUG("mpcTagDup: Failed to get Songlength of file: %s\n",
|
g_debug("mpcTagDup: Failed to get Songlength of file: %s\n",
|
||||||
file);
|
file);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user