simplified code in the ogg decoder plugin
Return early when the player thread sent us a command. This saves one level of indentation.
This commit is contained in:
parent
940ecf5345
commit
af58de6543
@ -232,7 +232,9 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
|
|||||||
callbacks.close_func = ogg_close_cb;
|
callbacks.close_func = ogg_close_cb;
|
||||||
callbacks.tell_func = ogg_tell_cb;
|
callbacks.tell_func = ogg_tell_cb;
|
||||||
if ((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) {
|
if ((ret = ov_open_callbacks(&data, &vf, NULL, 0, callbacks)) < 0) {
|
||||||
if (decoder_get_command(decoder) != DECODE_COMMAND_STOP) {
|
if (decoder_get_command(decoder) != DECODE_COMMAND_NONE)
|
||||||
|
return 0;
|
||||||
|
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case OV_EREAD:
|
case OV_EREAD:
|
||||||
errorStr = "read error";
|
errorStr = "read error";
|
||||||
@ -257,8 +259,6 @@ static int oggvorbis_decode(struct decoder * decoder, InputStream * inStream)
|
|||||||
errorStr);
|
errorStr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
audio_format.bits = 16;
|
audio_format.bits = 16;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user