summaryrefslogtreecommitdiff
path: root/libavcodec/libopenh264dec.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-11-18 10:45:08 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-11-18 10:45:08 +0100
commit0bd76401d1666bf8f0a67946d761ed9ba4751e49 (patch)
tree706638190fc8e565395e72ea6869e3c5e4775196 /libavcodec/libopenh264dec.c
parent6fb07c7d85c0d0464e5bdaaad55cc2b774468b3d (diff)
parent36b380dcd52ef47d7ba0559ed51192c88d82a9bd (diff)
Merge commit '36b380dcd52ef47d7ba0559ed51192c88d82a9bd'
* commit '36b380dcd52ef47d7ba0559ed51192c88d82a9bd': libopenh264dec: Simplify the init thanks to FF_CODEC_CAP_INIT_CLEANUP being set Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/libopenh264dec.c')
-rw-r--r--libavcodec/libopenh264dec.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index ab0a84c698..26cc8db9d1 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)