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:

committed by
Eric Wong

parent
c5e1bc39e9
commit
5a62c5cf9c
@@ -227,7 +227,6 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
OggCallbackData data;
|
OggCallbackData data;
|
||||||
int current_section;
|
int current_section;
|
||||||
int prev_section = -1;
|
int prev_section = -1;
|
||||||
int eof = 0;
|
|
||||||
long ret;
|
long ret;
|
||||||
#define OGG_CHUNK_SIZE 4096
|
#define OGG_CHUNK_SIZE 4096
|
||||||
char chunk[OGG_CHUNK_SIZE];
|
char chunk[OGG_CHUNK_SIZE];
|
||||||
@@ -278,7 +277,7 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
dc->totalTime = 0;
|
dc->totalTime = 0;
|
||||||
dc->audioFormat.bits = 16;
|
dc->audioFormat.bits = 16;
|
||||||
|
|
||||||
while (!eof) {
|
while (1) {
|
||||||
if (dc->seek) {
|
if (dc->seek) {
|
||||||
if (0 == ov_time_seek_page(&vf, dc->seekWhere)) {
|
if (0 == ov_time_seek_page(&vf, dc->seekWhere)) {
|
||||||
clearOutputBuffer(cb);
|
clearOutputBuffer(cb);
|
||||||
@@ -308,12 +307,12 @@ static int oggvorbis_decode(OutputBuffer * cb, DecoderControl * dc,
|
|||||||
|
|
||||||
prev_section = current_section;
|
prev_section = current_section;
|
||||||
|
|
||||||
if (ret <= 0 && ret != OV_HOLE) {
|
if (ret <= 0) {
|
||||||
eof = 1;
|
if (ret == OV_HOLE) /* bad packet */
|
||||||
break;
|
ret = 0;
|
||||||
|
else /* break on EOF or other error */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (ret == OV_HOLE)
|
|
||||||
ret = 0;
|
|
||||||
|
|
||||||
chunkpos += ret;
|
chunkpos += ret;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user