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
This commit is contained in:
Max Kellermann 2008-03-26 10:37:49 +00:00 committed by Eric Wong
parent c5e1bc39e9
commit 5a62c5cf9c
1 changed files with 6 additions and 7 deletions

View File

@ -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;