]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Original Commit: r82 | ods15 | 2006-09-29 21:03:43 +0300 (Fri, 29 Sep 2006) | 2 lines
authorods15 <ods15@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Oct 2006 06:08:39 +0000 (06:08 +0000)
committerods15 <ods15@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 2 Oct 2006 06:08:39 +0000 (06:08 +0000)
fix channels to be correct for rc->type==2 before classes[] decleration

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6487 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/vorbis_enc.c

index 514ef976db171899c0f89ce4286bb3fe6a701ec2..5cded20b8293696880841920bdfea95f531f202a 100644 (file)
@@ -923,13 +923,13 @@ static float * put_vector(codebook_t * book, PutBitContext * pb, float * num) {
     return &book->dimentions[entry * book->ndimentions];
 }
 
-static void residue_encode(venc_context_t * venc, residue_t * rc, PutBitContext * pb, float * coeffs, int samples, int channels) {
+static void residue_encode(venc_context_t * venc, residue_t * rc, PutBitContext * pb, float * coeffs, int samples, int real_ch) {
     int pass, i, j, p, k;
     int psize = rc->partition_size;
     int partitions = (rc->end - rc->begin) / psize;
+    int channels = (rc->type == 2) ? 1 : real_ch;
     int classes[channels][partitions];
     int classwords = venc->codebooks[rc->classbook].ndimentions;
-    int real_ch = channels;
 
     if (rc->type == 2) channels = 1;