Skip to content

Commit

Permalink
MSS1 and MSS2: set final pixel format after common stuff has been ini…
Browse files Browse the repository at this point in the history
…tialised

This way it won't interfere with WMV9 initialisation inside MSS2 decoder and
avplay will play it fine.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
  • Loading branch information
Alberto Delmás authored and Kostya Shishkov committed Aug 31, 2012
1 parent ee769c6 commit ede3d64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion libavcodec/mss1.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,16 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
static av_cold int mss1_decode_init(AVCodecContext *avctx)
{
MSS1Context * const c = avctx->priv_data;
int ret;

c->ctx.avctx = avctx;
avctx->coded_frame = &c->pic;

return ff_mss12_decode_init(&c->ctx, 0);
ret = ff_mss12_decode_init(&c->ctx, 0);

avctx->pix_fmt = PIX_FMT_PAL8;

return ret;
}

static av_cold int mss1_decode_end(AVCodecContext *avctx)
Expand Down
4 changes: 0 additions & 4 deletions libavcodec/mss12.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,6 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version)
return AVERROR(ENOMEM);
}

avctx->pix_fmt = version ? c->free_colours == 127 ? PIX_FMT_RGB555
: PIX_FMT_RGB24
: PIX_FMT_PAL8;

codec_init(c, version);

return 0;
Expand Down
4 changes: 4 additions & 0 deletions libavcodec/mss2.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx)
return ret;
}
ff_mss2dsp_init(&ctx->dsp);

avctx->pix_fmt = c->free_colours == 127 ? PIX_FMT_RGB555
: PIX_FMT_RGB24;

return 0;
}

Expand Down

0 comments on commit ede3d64

Please sign in to comment.