*/
/**
- * @file smacker.c
+ * @file libavcodec/smacker.c
* Smacker decoder
*/
int i;
int stride;
- if(buf_size == 769)
+ if(buf_size <= 769)
return 0;
if(smk->pic.data[0])
avctx->release_buffer(avctx, &smk->pic);
case 2:
for(i = 0; i < 2; i++) {
uint16_t pix1, pix2;
- pix1 = smk_get_code(&gb, smk->full_tbl, smk->full_last);
pix2 = smk_get_code(&gb, smk->full_tbl, smk->full_last);
+ pix1 = smk_get_code(&gb, smk->full_tbl, smk->full_last);
AV_WL16(out,pix1);
AV_WL16(out+2,pix2);
out += stride;
* Init smacker decoder
*
*/
-static int decode_init(AVCodecContext *avctx)
+static av_cold int decode_init(AVCodecContext *avctx)
{
SmackVContext * const c = avctx->priv_data;
* Uninit smacker decoder
*
*/
-static int decode_end(AVCodecContext *avctx)
+static av_cold int decode_end(AVCodecContext *avctx)
{
SmackVContext * const smk = avctx->priv_data;
}
-static int smka_decode_init(AVCodecContext *avctx)
+static av_cold int smka_decode_init(AVCodecContext *avctx)
{
+ avctx->sample_fmt = SAMPLE_FMT_S16;
+ avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
return 0;
}
decode_init,
NULL,
decode_end,
- decode_frame
+ decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("Smacker video"),
};
AVCodec smackaud_decoder = {
smka_decode_init,
NULL,
NULL,
- smka_decode_frame
+ smka_decode_frame,
+ .long_name = NULL_IF_CONFIG_SMALL("Smacker audio"),
};