From bb39a89a6a9ca5a384078b38123a010ec7f7e4a1 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 26 Feb 2016 18:14:02 +0000 Subject: [PATCH] ad_mpg123: minor code simplification. git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@37803 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_mpg123.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libmpcodecs/ad_mpg123.c b/libmpcodecs/ad_mpg123.c index 6a24e62..53700de 100644 --- a/libmpcodecs/ad_mpg123.c +++ b/libmpcodecs/ad_mpg123.c @@ -293,6 +293,11 @@ static int decode_a_bit(sh_audio_t *sh, unsigned char *buf, int count) if(con->new_format) ret = set_format(sh, con); + /* Theoretically, mpg123 could return MPG123_DONE, so be prepared. + * Should not happen in our usage, but it is a valid return code. */ + if (ret == MPG123_ERR || ret == MPG123_DONE) + break; + /* Feed the decoder. This will only fire from the second round on. */ if (ret == MPG123_NEED_MORE) { int incount; @@ -328,10 +333,6 @@ static int decode_a_bit(sh_audio_t *sh, unsigned char *buf, int count) ret = set_format(sh, con); } } - /* Theoretically, mpg123 could return MPG123_DONE, so be prepared. - * Should not happen in our usage, but it is a valid return code. */ - else if (ret == MPG123_ERR || ret == MPG123_DONE) - break; /* Try to decode a bit. This is the return value that counts * for the loop condition. */ -- 2.7.4