]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/smacker.c
Support the new lossless mode.
[ffmpeg] / libavcodec / smacker.c
index 62e78bd785ae7105085fc9ec1613400b33b7c3e4..bcdf792e3031543a963be7962ad8a56b648733f1 100644 (file)
@@ -457,8 +457,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const
                 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;
@@ -558,6 +558,8 @@ static av_cold int decode_end(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;
 }
 
@@ -698,7 +700,7 @@ AVCodec smacker_decoder = {
     NULL,
     decode_end,
     decode_frame,
-    .long_name = "Smacker video",
+    .long_name = NULL_IF_CONFIG_SMALL("Smacker video"),
 };
 
 AVCodec smackaud_decoder = {
@@ -710,6 +712,6 @@ AVCodec smackaud_decoder = {
     NULL,
     NULL,
     smka_decode_frame,
-    .long_name = "Smacker audio",
+    .long_name = NULL_IF_CONFIG_SMALL("Smacker audio"),
 };