[FFmpeg-cvslog] avcodec/fmvc: small refactoring in decode_type1()

Diego Biurrun git at videolan.org
Tue Mar 21 12:51:30 EET 2017


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Mar 21 11:46:43 2017 +0100| [b4da4307a91e477e98f62498590a5dafb9d08204] | committer: Paul B Mahol

avcodec/fmvc: small refactoring in decode_type1()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b4da4307a91e477e98f62498590a5dafb9d08204
---

 libavcodec/fmvc.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/libavcodec/fmvc.c b/libavcodec/fmvc.c
index 9c452da..1f8b0c5 100644
--- a/libavcodec/fmvc.c
+++ b/libavcodec/fmvc.c
@@ -380,18 +380,14 @@ static int decode_type1(GetByteContext *gb, PutByteContext *pb)
             bytestream2_put_byte(pb, bytestream2_get_byte(&gbc));
             bytestream2_put_byte(pb, bytestream2_get_byte(&gbc));
             bytestream2_put_byte(pb, bytestream2_get_byte(&gbc));
-            do {
-                bytestream2_put_byte(pb, bytestream2_get_byte(&gbc));
-                --len;
-            } while (len && bytestream2_get_bytes_left(&gbc) > 0);
         } else {
             bytestream2_put_le32(pb, bytestream2_get_le32(&gbc));
             len--;
-            do {
-                bytestream2_put_byte(pb, bytestream2_get_byte(&gbc));
-                len--;
-            } while (len && bytestream2_get_bytes_left(&gbc) > 0);
         }
+        do {
+            bytestream2_put_byte(pb, bytestream2_get_byte(&gbc));
+            len--;
+        } while (len && bytestream2_get_bytes_left(&gbc) > 0);
     }
 
     return 0;



More information about the ffmpeg-cvslog mailing list