Codebase list faad2 / 678aaac
Fixed a number of compiler warnings because of unused variables + fixed use of un-initialized variable. LoRd_MuldeR 6 years ago
3 changed file(s) with 37 addition(s) and 36 deletion(s). Raw diff Collapse all Expand all
571571
572572 /* get AAC infos for printing */
573573 header_type = 0;
574 if (streaminput == 1 )
575 lookforheader(&b);
574 if (streaminput == 1)
575 lookforheader(&b);
576576
577577 if ((b.buffer[0] == 0xFF) && ((b.buffer[1] & 0xF6) == 0xF0))
578578 {
579 if (streaminput ==1)
580 {
581 int frames, frame_length;
582 int samplerate;
583 float frames_per_sec, bytes_per_frame;
584 samplerate = adts_sample_rates[(b.buffer[2]&0x3c)>>2];
585 frame_length = ((((unsigned int)b.buffer[3] & 0x3)) << 11)
586 | (((unsigned int)b.buffer[4]) << 3) | (b.buffer[5] >> 5);
587
588 frames_per_sec = (float)samplerate/1024.0f;
589 bytes_per_frame = (float)frame_length/(float)(1000);
590 bitrate = (int)(8. * bytes_per_frame * frames_per_sec + 0.5);
591 length = 1;
592 faad_fprintf(stderr, "Streamed input format samplerate %d channels %d.\n",samplerate,channels);
593
594 } else {
595 adts_parse(&b, &bitrate, &length);
596 fseek(b.infile, tagsize, SEEK_SET);
597
598 bread = fread(b.buffer, 1, FAAD_MIN_STREAMSIZE*MAX_CHANNELS, b.infile);
599 if (bread != FAAD_MIN_STREAMSIZE*MAX_CHANNELS)
600 b.at_eof = 1;
601 else
602 b.at_eof = 0;
603 b.bytes_into_buffer = bread;
604 b.bytes_consumed = 0;
605 b.file_offset = tagsize;
606 }
579 if (streaminput == 1)
580 {
581 int /*frames,*/ frame_length;
582 int samplerate;
583 float frames_per_sec, bytes_per_frame;
584 channels = 2;
585 samplerate = adts_sample_rates[(b.buffer[2]&0x3c)>>2];
586 frame_length = ((((unsigned int)b.buffer[3] & 0x3)) << 11)
587 | (((unsigned int)b.buffer[4]) << 3) | (b.buffer[5] >> 5);
588 frames_per_sec = (float)samplerate/1024.0f;
589 bytes_per_frame = (float)frame_length/(float)(1000);
590 bitrate = (int)(8. * bytes_per_frame * frames_per_sec + 0.5);
591 length = 1;
592 faad_fprintf(stderr, "Streamed input format samplerate %d channels %d.\n", samplerate, channels);
593 } else {
594 adts_parse(&b, &bitrate, &length);
595 fseek(b.infile, tagsize, SEEK_SET);
596
597 bread = fread(b.buffer, 1, FAAD_MIN_STREAMSIZE*MAX_CHANNELS, b.infile);
598 if (bread != FAAD_MIN_STREAMSIZE*MAX_CHANNELS)
599 b.at_eof = 1;
600 else
601 b.at_eof = 0;
602 b.bytes_into_buffer = bread;
603 b.bytes_consumed = 0;
604 b.file_offset = tagsize;
605 }
607606
608607 header_type = 1;
609 } else if (memcmp(b.buffer, "ADIF", 4) == 0) {
608 }
609 else if (memcmp(b.buffer, "ADIF", 4) == 0)
610 {
610611 int skip_size = (b.buffer[4] & 0x80) ? 9 : 0;
611612 bitrate = ((unsigned int)(b.buffer[4 + skip_size] & 0x0F)<<19) |
612613 ((unsigned int)b.buffer[5 + skip_size]<<11) |
784785 int outputFormat, int fileType, int downMatrix, int noGapless,
785786 int infoOnly, int adts_out, float *song_length, float seek_to)
786787 {
787 int track;
788 /*int track;*/
788789 unsigned long samplerate;
789790 unsigned char channels;
790791 void *sample_buffer;
875876 faad_fprintf(stderr, "%s file info:\n\n", mp4file);
876877 {
877878 char *tag = NULL, *item = NULL;
878 int k, j;
879 /*int k, j;*/
879880 char *ot[6] = { "NULL", "MAIN AAC", "LC AAC", "SSR AAC", "LTP AAC", "HE AAC" };
880881 float seconds;
881882 seconds = (float)mp4config.samples/(float)mp4ASC.samplingFrequency;
900901 mp4read_seek(startSampleId);
901902 for (sampleId = startSampleId; sampleId < mp4config.frame.ents; sampleId++)
902903 {
903 int rc;
904 /*int rc;*/
904905 long dur;
905906 unsigned int sample_count;
906907 unsigned int delay = 0;
224224
225225 uint16_t sp_offset[8];
226226 uint16_t g, i, sortloop, set, bitsread;
227 uint16_t bitsleft, codewordsleft;
227 /*uint16_t bitsleft, codewordsleft*/;
228228 uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB;
229229
230230 const uint16_t nshort = hDecoder->frameLength/8;
240240 (ics_left->ms_used[g][sfb])) ||
241241 (ics_left->ms_mask_present == 2)))
242242 {
243 uint16_t c;
243 /*uint16_t c;*/
244244
245245 offs = ics_right->swb_offset[sfb];
246246 size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;