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>
This commit is contained in:
commit
0bd76401d1
@ -72,15 +72,12 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
s->packet_fifo = av_fifo_alloc(sizeof(AVPacket));
|
s->packet_fifo = av_fifo_alloc(sizeof(AVPacket));
|
||||||
if (!s->packet_fifo) {
|
if (!s->packet_fifo)
|
||||||
err = AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WelsCreateDecoder(&s->decoder)) {
|
if (WelsCreateDecoder(&s->decoder)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n");
|
av_log(avctx, AV_LOG_ERROR, "Unable to create decoder\n");
|
||||||
err = AVERROR_UNKNOWN;
|
return AVERROR_UNKNOWN;
|
||||||
goto fail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass all libopenh264 messages to our callback, to allow ourselves to filter them.
|
// 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, ¶m) != cmResultSuccess) {
|
if ((*s->decoder)->Initialize(s->decoder, ¶m) != cmResultSuccess) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Initialize failed\n");
|
av_log(avctx, AV_LOG_ERROR, "Initialize failed\n");
|
||||||
err = AVERROR_UNKNOWN;
|
return AVERROR_UNKNOWN;
|
||||||
goto fail;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
|
avctx->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||||
|
|
||||||
fail:
|
return 0;
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init_bsf(AVCodecContext *avctx)
|
static int init_bsf(AVCodecContext *avctx)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user