aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/oggvorbis_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:27:14 +0200
committerEric Wong <normalperson@yhbt.net>2008-08-30 19:50:17 -0700
commitd855b25b96aba8ca883e886ad229e83c0b31005c (patch)
treefeafe0121bbff75af48787690daad8fa0d5dae17 /src/inputPlugins/oggvorbis_plugin.c
parent5136928aef27ae6e81ef56b7f005e04455d35c2f (diff)
downloadmpd-d855b25b96aba8ca883e886ad229e83c0b31005c.tar.gz
mpd-d855b25b96aba8ca883e886ad229e83c0b31005c.tar.xz
mpd-d855b25b96aba8ca883e886ad229e83c0b31005c.zip
simplified code in the ogg decoder plugin
Return early when the player thread sent us a command. This saves one level of indentation.
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/oggvorbis_plugin.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c
index a28bbc737..75c52dab4 100644
--- a/src/inputPlugins/oggvorbis_plugin.c
+++ b/src/inputPlugins/oggvorbis_plugin.c
@@ -240,32 +240,32 @@ static int oggvorbis_decode(InputStream * inStream)
callbacks.close_func = ogg_close_cb;
callbacks.tell_func = ogg_tell_cb;
if ((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) {
- if (!dc_intr()) {
- switch (ret) {
- case OV_EREAD:
- errorStr = "read error";
- break;
- case OV_ENOTVORBIS:
- errorStr = "not vorbis stream";
- break;
- case OV_EVERSION:
- errorStr = "vorbis version mismatch";
- break;
- case OV_EBADHEADER:
- errorStr = "invalid vorbis header";
- break;
- case OV_EFAULT:
- errorStr = "internal logic error";
- break;
- default:
- errorStr = "unknown error";
- break;
- }
- ERROR("Error decoding Ogg Vorbis stream: %s\n",
- errorStr);
- return -1;
+ if (dc_intr())
+ return 0;
+
+ switch (ret) {
+ case OV_EREAD:
+ errorStr = "read error";
+ break;
+ case OV_ENOTVORBIS:
+ errorStr = "not vorbis stream";
+ break;
+ case OV_EVERSION:
+ errorStr = "vorbis version mismatch";
+ break;
+ case OV_EBADHEADER:
+ errorStr = "invalid vorbis header";
+ break;
+ case OV_EFAULT:
+ errorStr = "internal logic error";
+ break;
+ default:
+ errorStr = "unknown error";
+ break;
}
- return 0;
+
+ ERROR("Error decoding Ogg Vorbis stream: %s\n", errorStr);
+ return -1;
}
dc.total_time = ov_time_total(&vf, -1);
if (dc.total_time < 0)