mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-05 12:07:49 +00:00
lavc/h264: simplify find_unused_picture()
This commit is contained in:
parent
bcfa8551a1
commit
e5ac554ba7
@ -254,25 +254,15 @@ fail:
|
||||
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)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
|
||||
if (pic_is_unused(h, &h->DPB[i]))
|
||||
break;
|
||||
if (!h->DPB[i].f->buf[0])
|
||||
return i;
|
||||
}
|
||||
if (i == H264_MAX_PICTURE_COUNT)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
return i;
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user