Commit e5ac554b authored by Clément Bœsch's avatar Clément Bœsch Committed by Clément Bœsch

lavc/h264: simplify find_unused_picture()

parent bcfa8551
...@@ -254,25 +254,15 @@ fail: ...@@ -254,25 +254,15 @@ fail:
return (ret < 0) ? ret : AVERROR(ENOMEM); return (ret < 0) ? ret : AVERROR(ENOMEM);
} }
static inline int pic_is_unused(H264Context *h, H264Picture *pic)
{
if (!pic->f->buf[0])
return 1;
return 0;
}
static int find_unused_picture(H264Context *h) static int find_unused_picture(H264Context *h)
{ {
int i; int i;
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) { for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
if (pic_is_unused(h, &h->DPB[i])) if (!h->DPB[i].f->buf[0])
break; return i;
} }
if (i == H264_MAX_PICTURE_COUNT) return AVERROR_INVALIDDATA;
return AVERROR_INVALIDDATA;
return i;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment