aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2016-07-14 22:20:25 +0300
committerMartin Storsjö <martin@martin.st>2016-07-15 13:36:21 +0300
commit36b380dcd52ef47d7ba0559ed51192c88d82a9bd (patch)
tree04d4223a26f5389775a8677e44d129493f19bfcb
parentd0b1e6049b06eeeeca146ece4d2f199c5dba1565 (diff)
downloadffmpeg-36b380dcd52ef47d7ba0559ed51192c88d82a9bd.tar.gz
libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being set
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavcodec/libopenh264dec.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index a105fa52d9..cc18f240a6 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -72,15 +72,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
return err;
s->packet_fifo = av_fifo_alloc(sizeof(AVPacket));
- if (!s->packet_fifo) {
- err = AVERROR(ENOMEM);
- goto fail;
- }
+ if (!s->packet_fifo)
+ return AVERROR(ENOMEM);
if (WelsCreateDecoder(&s->decoder)) {
av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n");
- err = AVERROR_UNKNOWN;
- goto fail;
+ return AVERROR_UNKNOWN;
}
// Pass all libopenh264 messages to our callback, to allow ourselves to filter them.
@@ -98,14 +95,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
if ((*s->decoder)->Initialize(s->decoder, &param) != cmResultSuccess) {
av_log(avctx, AV_LOG_ERROR, "Initialize failed\n");
- err = AVERROR_UNKNOWN;
- goto fail;
+ return AVERROR_UNKNOWN;
}
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-fail:
- return err;
+ return 0;
}
static int init_bsf(AVCodecContext *avctx)