diff options
author | wm4 <wm4@nowhere> | 2013-12-21 23:15:32 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-12-21 23:15:32 +0100 |
commit | 0a3e9a9ac3a90da831b497e0613dfb66bc14f3d2 (patch) | |
tree | b70f214f8c3fc802d6d6edbf8395273c854ac0fd /audio/decode/ad_mpg123.c | |
parent | a4fe95b0d8d339ba5afbdb5346ad8fd367a4a1c1 (diff) | |
parent | 245e5b844177e9ad9a9c07eff5efab7c3fccdebc (diff) | |
download | mpv-0a3e9a9ac3a90da831b497e0613dfb66bc14f3d2.tar.bz2 mpv-0a3e9a9ac3a90da831b497e0613dfb66bc14f3d2.tar.xz |
Merge branch 'msg_refactor'
This branch changes mp_msg() so that it doesn't require global context.
The changes are pretty violent.
Diffstat (limited to 'audio/decode/ad_mpg123.c')
-rw-r--r-- | audio/decode/ad_mpg123.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/audio/decode/ad_mpg123.c b/audio/decode/ad_mpg123.c index 57f84e136f..4d4fd52862 100644 --- a/audio/decode/ad_mpg123.c +++ b/audio/decode/ad_mpg123.c @@ -115,10 +115,10 @@ static int preinit(struct dec_audio *da) bad_end: if (!con->handle) - mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 preinit error: %s\n", + MP_ERR(da, "mpg123 preinit error: %s\n", mpg123_plain_strerror(err)); else - mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 preinit error: %s\n", + MP_ERR(da, "mpg123 preinit error: %s\n", mpg123_strerror(con->handle)); uninit(da); @@ -156,8 +156,7 @@ static int set_format(struct dec_audio *da) int af = mpg123_format_to_af(encoding); if (!af) { /* This means we got a funny custom build of libmpg123 that only supports an unknown format. */ - mp_msg(MSGT_DECAUDIO, MSGL_ERR, - "Bad encoding from mpg123: %i.\n", encoding); + MP_ERR(da, "Bad encoding from mpg123: %i.\n", encoding); return MPG123_ERR; } mp_audio_set_format(&da->decoded, af); @@ -236,9 +235,9 @@ static int init(struct dec_audio *da, const char *decoder) fail: if (ret == MPG123_NEED_MORE) { - mp_msg(MSGT_DECAUDIO, MSGL_ERR, "Could not find mp3 stream.\n"); + MP_ERR(da, "Could not find mp3 stream.\n"); } else { - mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 init error: %s\n", + MP_ERR(da, "mpg123 init error: %s\n", mpg123_strerror(con->handle)); } @@ -337,7 +336,7 @@ static int decode_audio(struct dec_audio *da, struct mp_audio *buffer, int maxle return 0; mpg123_fail: - mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 decoding error: %s\n", + MP_ERR(da, "mpg123 decoding error: %s\n", mpg123_strerror(con->handle)); return -1; } @@ -351,8 +350,7 @@ static int control(struct dec_audio *da, int cmd, void *arg) mpg123_close(con->handle); if (mpg123_open_feed(con->handle) != MPG123_OK) { - mp_msg(MSGT_DECAUDIO, MSGL_ERR, - "mpg123 failed to reopen stream: %s\n", + MP_ERR(da, "mpg123 failed to reopen stream: %s\n", mpg123_strerror(con->handle)); return CONTROL_FALSE; } |