aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-03-25 12:32:45 +0100
committerClément Bœsch <u@pkh.me>2017-03-27 21:38:21 +0200
commit0f8ae9d7b29ddf7040ecaf6bb573c46afdb21cf1 (patch)
treebf7aca113040087f9987f8b1ef448a8391d4042a
parentf4d95e0949fb7c483d0e5dc5addf049ce0e3fe6c (diff)
downloadffmpeg-0f8ae9d7b29ddf7040ecaf6bb573c46afdb21cf1.tar.gz
lavc/vp9: split a few assignment out of ifs
-rw-r--r--libavcodec/vp9.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 964053d9f2..f2235a57f8 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -50,10 +50,13 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f)
VP9Context *s = avctx->priv_data;
int ret, sz;
- if ((ret = ff_thread_get_buffer(avctx, &f->tf, AV_GET_BUFFER_FLAG_REF)) < 0)
+ ret = ff_thread_get_buffer(avctx, &f->tf, AV_GET_BUFFER_FLAG_REF);
+ if (ret < 0)
return ret;
+
sz = 64 * s->sb_cols * s->sb_rows;
- if (!(f->extradata = av_buffer_allocz(sz * (1 + sizeof(struct VP9mvrefPair))))) {
+ f->extradata = av_buffer_allocz(sz * (1 + sizeof(struct VP9mvrefPair)));
+ if (!f->extradata) {
goto fail;
}
@@ -82,11 +85,13 @@ static int vp9_frame_ref(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src)
{
int res;
- if ((res = ff_thread_ref_frame(&dst->tf, &src->tf)) < 0) {
+ res = ff_thread_ref_frame(&dst->tf, &src->tf);
+ if (res < 0)
return res;
- } else if (!(dst->extradata = av_buffer_ref(src->extradata))) {
+
+ dst->extradata = av_buffer_ref(src->extradata);
+ if (!dst->extradata)
goto fail;
- }
dst->segmentation_map = src->segmentation_map;
dst->mv = src->mv;