]> git.sesse.net Git - ffmpeg/commitdiff
tests/api-band-test: simplify code
authorAnton Khirnov <anton@khirnov.net>
Wed, 27 Jan 2021 10:08:29 +0000 (11:08 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 25 Feb 2021 10:46:28 +0000 (11:46 +0100)
tests/api/api-band-test.c

index 34bed1d6be7e8400bdf2cbcad983ccbe93e297d0..717c9441a4b39e44c2b64b261393e3c96c6f71d0 100644 (file)
@@ -167,10 +167,8 @@ static int video_decode(const char *input_filename)
             continue;
         }
 
-        if (result < 0)
-            result = avcodec_send_packet(ctx, NULL);
-        else
-            result = avcodec_send_packet(ctx, pkt);
+        // pkt will be empty on read error/EOF
+        result = avcodec_send_packet(ctx, pkt);
 
         av_packet_unref(pkt);