comparison flacdec.c @ 9211:2acf888276af libavcodec

flacdec: remove unneeded variable, 'assignment'
author jbr
date Sat, 21 Mar 2009 00:48:07 +0000
parents ca10c935dc56
children 782d31263979
comparison
equal deleted inserted replaced
9210:ca10c935dc56 9211:2acf888276af
490 return 0; 490 return 0;
491 } 491 }
492 492
493 static int decode_frame(FLACContext *s, int alloc_data_size) 493 static int decode_frame(FLACContext *s, int alloc_data_size)
494 { 494 {
495 int blocksize_code, sample_rate_code, sample_size_code, assignment, i, crc8; 495 int blocksize_code, sample_rate_code, sample_size_code, i, crc8;
496 int ch_mode, bps, blocksize, samplerate; 496 int ch_mode, bps, blocksize, samplerate;
497 497
498 blocksize_code = get_bits(&s->gb, 4); 498 blocksize_code = get_bits(&s->gb, 4);
499 499
500 sample_rate_code = get_bits(&s->gb, 4); 500 sample_rate_code = get_bits(&s->gb, 4);
501 501
502 assignment = get_bits(&s->gb, 4); /* channel assignment */ 502 ch_mode = get_bits(&s->gb, 4); /* channel assignment */
503 if (assignment < FLAC_MAX_CHANNELS && s->channels == assignment+1) 503 if (ch_mode < FLAC_MAX_CHANNELS && s->channels == ch_mode+1) {
504 ch_mode = FLAC_CHMODE_INDEPENDENT; 504 ch_mode = FLAC_CHMODE_INDEPENDENT;
505 else if (assignment >= FLAC_MAX_CHANNELS && assignment < 11 && s->channels == 2) 505 } else if (ch_mode > FLAC_CHMODE_MID_SIDE || s->channels != 2) {
506 ch_mode = assignment;
507 else {
508 av_log(s->avctx, AV_LOG_ERROR, "unsupported channel assignment %d (channels=%d)\n", 506 av_log(s->avctx, AV_LOG_ERROR, "unsupported channel assignment %d (channels=%d)\n",
509 assignment, s->channels); 507 ch_mode, s->channels);
510 return -1; 508 return -1;
511 } 509 }
512 510
513 sample_size_code = get_bits(&s->gb, 3); 511 sample_size_code = get_bits(&s->gb, 3);
514 if (sample_size_code == 0) 512 if (sample_size_code == 0)