h264: simplify code in flush_dpb()
authorAnton Khirnov <anton@khirnov.net>
Thu, 20 Nov 2014 06:40:34 +0000 (07:40 +0100)
committerAnton Khirnov <anton@khirnov.net>
Tue, 27 Jan 2015 07:34:24 +0000 (08:34 +0100)
There is no point in clearing reference explicitly, since that will be
done as a part of ff_h264_unref_picture() right below.

libavcodec/h264.c

index b902422..684c78f 100644 (file)
@@ -1075,11 +1075,7 @@ static void flush_dpb(AVCodecContext *avctx)
     H264Context *h = avctx->priv_data;
     int i;
 
-    for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++) {
-        if (h->delayed_pic[i])
-            h->delayed_pic[i]->reference = 0;
-        h->delayed_pic[i] = NULL;
-    }
+    memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
 
     ff_h264_flush_change(h);