diff mbox series

[FFmpeg-devel,1/5] tests/api-band-test: simplify code

Message ID 20210224100402.22300-1-anton@khirnov.net
State Accepted
Commit a5b737e6250e4a335f1d32ec6994614fa092a854
Headers show
Series [FFmpeg-devel,1/5] tests/api-band-test: simplify code | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Anton Khirnov Feb. 24, 2021, 10:03 a.m. UTC
---
 tests/api/api-band-test.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

James Almer Feb. 24, 2021, 2:03 p.m. UTC | #1
On 2/24/2021 7:03 AM, Anton Khirnov wrote:
> ---
>   tests/api/api-band-test.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/api/api-band-test.c b/tests/api/api-band-test.c
> index 34bed1d6be..717c9441a4 100644
> --- a/tests/api/api-band-test.c
> +++ b/tests/api/api-band-test.c
> @@ -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);

LGTM.
diff mbox series

Patch

diff --git a/tests/api/api-band-test.c b/tests/api/api-band-test.c
index 34bed1d6be..717c9441a4 100644
--- a/tests/api/api-band-test.c
+++ b/tests/api/api-band-test.c
@@ -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);