Fixed a number of compiler warnings because of unused variables + fixed use of un-initialized variable.
LoRd_MuldeR
6 years ago
571 | 571 | |
572 | 572 | /* get AAC infos for printing */ |
573 | 573 | header_type = 0; |
574 | if (streaminput == 1 ) | |
575 | lookforheader(&b); | |
574 | if (streaminput == 1) | |
575 | lookforheader(&b); | |
576 | 576 | |
577 | 577 | if ((b.buffer[0] == 0xFF) && ((b.buffer[1] & 0xF6) == 0xF0)) |
578 | 578 | { |
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 | } | |
607 | 606 | |
608 | 607 | header_type = 1; |
609 | } else if (memcmp(b.buffer, "ADIF", 4) == 0) { | |
608 | } | |
609 | else if (memcmp(b.buffer, "ADIF", 4) == 0) | |
610 | { | |
610 | 611 | int skip_size = (b.buffer[4] & 0x80) ? 9 : 0; |
611 | 612 | bitrate = ((unsigned int)(b.buffer[4 + skip_size] & 0x0F)<<19) | |
612 | 613 | ((unsigned int)b.buffer[5 + skip_size]<<11) | |
784 | 785 | int outputFormat, int fileType, int downMatrix, int noGapless, |
785 | 786 | int infoOnly, int adts_out, float *song_length, float seek_to) |
786 | 787 | { |
787 | int track; | |
788 | /*int track;*/ | |
788 | 789 | unsigned long samplerate; |
789 | 790 | unsigned char channels; |
790 | 791 | void *sample_buffer; |
875 | 876 | faad_fprintf(stderr, "%s file info:\n\n", mp4file); |
876 | 877 | { |
877 | 878 | char *tag = NULL, *item = NULL; |
878 | int k, j; | |
879 | /*int k, j;*/ | |
879 | 880 | char *ot[6] = { "NULL", "MAIN AAC", "LC AAC", "SSR AAC", "LTP AAC", "HE AAC" }; |
880 | 881 | float seconds; |
881 | 882 | seconds = (float)mp4config.samples/(float)mp4ASC.samplingFrequency; |
900 | 901 | mp4read_seek(startSampleId); |
901 | 902 | for (sampleId = startSampleId; sampleId < mp4config.frame.ents; sampleId++) |
902 | 903 | { |
903 | int rc; | |
904 | /*int rc;*/ | |
904 | 905 | long dur; |
905 | 906 | unsigned int sample_count; |
906 | 907 | unsigned int delay = 0; |