aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/oggvorbis_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-03-26 10:37:49 +0000
committerEric Wong <normalperson@yhbt.net>2008-03-26 10:37:49 +0000
commit5a62c5cf9ce45542d1c90080791b0b4e9f5c24a3 (patch)
tree475010a8afce69d0771fb3506c23542bb17c5abd /src/inputPlugins/oggvorbis_plugin.c
parentc5e1bc39e95fb2423146e062c7efade70bac2c8f (diff)
downloadmpd-5a62c5cf9ce45542d1c90080791b0b4e9f5c24a3.tar.gz
mpd-5a62c5cf9ce45542d1c90080791b0b4e9f5c24a3.tar.xz
mpd-5a62c5cf9ce45542d1c90080791b0b4e9f5c24a3.zip
inputPlugins/oggvorbis: removed unused variables
The local variable eof can actually be replaced with a simple "break". With a negative ret, the value of chunkpos can be invalidated, I am not sure if this might have been a bug. [ew: no, a negative ret will correspond to ret == OV_HOLE and ret will be reset to zero leaving chunkpos untouched (code cleaned up to make this more obvious] git-svn-id: https://svn.musicpd.org/mpd/trunk@7202 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/inputPlugins/oggvorbis_plugin.c')
-rw-r--r--src/inputPlugins/oggvorbis_plugin.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/inputPlugins/oggvorbis_plugin.c b/src/inputPlugins/oggvorbis_plugin.c
index ec1c44ac6..539dc55b7 100644
--- a/src/inputPlugins/oggvorbis_plugin.c
+++ b/src/inputPlugins/oggvorbis_plugin.c
@@ -227,7 +227,6 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
OggCallbackData data;
int current_section;
int prev_section = -1;
- int eof = 0;
long ret;
#define OGG_CHUNK_SIZE 4096
char chunk[OGG_CHUNK_SIZE];
@@ -278,7 +277,7 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
dc->totalTime = 0;
dc->audioFormat.bits = 16;
- while (!eof) {
+ while (1) {
if (dc->seek) {
if (0 == ov_time_seek_page(&vf, dc->seekWhere)) {
clearOutputBuffer(cb);
@@ -308,12 +307,12 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
prev_section = current_section;
- if (ret <= 0 && ret != OV_HOLE) {
- eof = 1;
- break;
+ if (ret <= 0) {
+ if (ret == OV_HOLE) /* bad packet */
+ ret = 0;
+ else /* break on EOF or other error */
+ break;
}
- if (ret == OV_HOLE)
- ret = 0;
chunkpos += ret;