From 14c6150fd995ca4bb0a3a4415d9d1bbdf3bdc7c8 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Fri, 5 Nov 2004 05:12:58 +0000 Subject: more descriptive error messages for mpd git-svn-id: https://svn.musicpd.org/mpd/trunk@2514 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputPlugins/ogg_plugin.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/inputPlugins/ogg_plugin.c b/src/inputPlugins/ogg_plugin.c index da08cb2e2..d6add6d3a 100644 --- a/src/inputPlugins/ogg_plugin.c +++ b/src/inputPlugins/ogg_plugin.c @@ -242,10 +242,30 @@ int ogg_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream) callbacks.close_func = ogg_close_cb; callbacks.tell_func = ogg_tell_cb; - if(ov_open_callbacks(&data, &vf, NULL, 0, callbacks) < 0) { + if((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) { closeInputStream(inStream); if(!dc->stop) { - ERROR("Input does not appear to be an Ogg Vorbis stream.\n"); + ERROR("Error decoding Ogg Vorbis stream: "); + switch(ret) { + case OV_EREAD: + ERROR("read error\n"); + break; + case OV_ENOTVORBIS: + ERROR("not vorbis stream\n"); + break; + case OV_EVERSION: + ERROR("vorbis version mismatch\n"); + break; + case OV_EBADHEADER: + ERROR("invalid vorbis header\n"); + break; + case OV_EFAULT: + ERROR("internal logic error\n"); + break; + default: + ERROR("unknown error\n"); + break; + } return -1; } else { -- cgit v1.2.3