]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpc7.c
CD+G demuxer and decoder
[ffmpeg] / libavcodec / mpc7.c
index a15f117427eff8cdb1b1017a40221c76a081c72d..e80b8927f26794fe36b0b267d6b8feb9c73a8967 100644 (file)
@@ -78,13 +78,16 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
         av_log(avctx, AV_LOG_ERROR, "Too many bands: %i\n", c->maxbands);
         return -1;
     }
-    skip_bits(&gb, 88);
+    skip_bits_long(&gb, 88);
     c->gapless = get_bits1(&gb);
     c->lastframelen = get_bits(&gb, 11);
     av_log(avctx, AV_LOG_DEBUG, "IS: %d, MSS: %d, TG: %d, LFL: %d, bands: %d\n",
             c->IS, c->MSS, c->gapless, c->lastframelen, c->maxbands);
     c->frames_to_skip = 0;
 
+    avctx->sample_fmt = SAMPLE_FMT_S16;
+    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
+
     if(vlc_initialized) return 0;
     av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
     scfi_vlc.table = scfi_table;
@@ -124,8 +127,6 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
         }
     }
     vlc_initialized = 1;
-    avctx->sample_fmt = SAMPLE_FMT_S16;
-    avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
     return 0;
 }