diff mbox series

[FFmpeg-devel,13/14] avcodec/ffv1dec: Combine identical checks

Message ID HE1PR0301MB2154811B4D3E1C7DC9F6EDD88F449@HE1PR0301MB2154.eurprd03.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel,01/14] avcodec/ffv1dec: Remove redundant writes, fix races
Related show

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

Andreas Rheinhardt April 24, 2021, 11:14 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/ffv1dec.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 060efc25ab..9a755937e6 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -234,16 +234,14 @@  static int decode_slice(AVCodecContext *c, void *arg)
 
     av_assert1(si >= 0 && si < MAX_SLICES && f->slice_context[si] == fs);
 
-    if(f->fsrc && !p->key_frame)
-        ff_thread_await_progress(&f->last_picture, si, 0);
-
     if(f->fsrc && !p->key_frame) {
         FFV1Context *fssrc = f->fsrc->slice_context[si];
         FFV1Context *fsdst = fs;
+
         av_assert1(fsdst->plane_count == fssrc->plane_count);
+        ff_thread_await_progress(&f->last_picture, si, 0);
 
-        if (!p->key_frame)
-            fsdst->slice_damaged |= fssrc->slice_damaged;
+        fsdst->slice_damaged |= fssrc->slice_damaged;
 
         for (i = 0; i < f->plane_count; i++) {
             PlaneContext *psrc = &fssrc->plane[i];