Merge commit '730bac7bab3c7dcd9fcb7c70f154e5f4cfaef9a7'
* commit '730bac7bab3c7dcd9fcb7c70f154e5f4cfaef9a7': mss4: use the AVFrame API properly. mss3: use the AVFrame API properly. mss2: use the AVFrame API properly. mss1: use the AVFrame API properly. Conflicts: libavcodec/mss1.c libavcodec/mss2.c libavcodec/mss3.c libavcodec/mss4.c See:02fe531afeSee:ff1c13b133See:310bf28354Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -626,14 +626,23 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
return buf_size;
|
||||
}
|
||||
|
||||
static av_cold int mss4_decode_init(AVCodecContext *avctx)
|
||||
static av_cold int mss4_decode_end(AVCodecContext *avctx)
|
||||
{
|
||||
MSS4Context * const c = avctx->priv_data;
|
||||
int i;
|
||||
|
||||
c->pic = av_frame_alloc();
|
||||
if (!c->pic)
|
||||
return AVERROR(ENOMEM);
|
||||
av_frame_free(&c->pic);
|
||||
for (i = 0; i < 3; i++)
|
||||
av_freep(&c->prev_dc[i]);
|
||||
mss4_free_vlcs(c);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold int mss4_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
MSS4Context * const c = avctx->priv_data;
|
||||
int i;
|
||||
|
||||
if (mss4_init_vlcs(c)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n");
|
||||
@@ -650,25 +659,17 @@ static av_cold int mss4_decode_init(AVCodecContext *avctx)
|
||||
}
|
||||
}
|
||||
|
||||
c->pic = av_frame_alloc();
|
||||
if (!c->pic) {
|
||||
mss4_decode_end(avctx);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
avctx->pix_fmt = AV_PIX_FMT_YUV444P;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold int mss4_decode_end(AVCodecContext *avctx)
|
||||
{
|
||||
MSS4Context * const c = avctx->priv_data;
|
||||
int i;
|
||||
|
||||
av_frame_free(&c->pic);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
av_freep(&c->prev_dc[i]);
|
||||
mss4_free_vlcs(c);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AVCodec ff_mts2_decoder = {
|
||||
.name = "mts2",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("MS Expression Encoder Screen"),
|
||||
|
||||
Reference in New Issue
Block a user