Lines Matching refs:global

359 /* global data for get_audio.c. */
379 static get_audio_global_data global;
576 will not change unless we enable gapless mode. Also, global.hip is not
580 mpg123_getstate(global.hip->mh, MPG123_DEC_DELAY, &dec_delay, NULL);
627 global. pcm16.skip_start = global.pcm32.skip_start = skip_start;
628 global. pcm16.skip_end = global.pcm32.skip_end = skip_end;
638 global. count_samples_carefully = 0;
639 global. num_samples_read = 0;
640 global. pcmbitwidth = global_raw_pcm.in_bitwidth;
641 global. pcmswapbytes = global_reader.swapbytes;
642 global. pcm_is_unsigned_8bit = global_raw_pcm.in_signed == 1 ? 0 : 1;
643 global. pcm_is_ieee_float = 0;
644 global. hip = 0;
645 global. music_in = 0;
646 global. snd_file = 0;
647 global. in_id3v2_size = 0;
648 global. in_id3v2_tag = 0;
650 global. music_in = open_mpeg_file(gfp, inPath, &enc_delay, &enc_padding);
655 global. snd_file = open_snd_file(gfp, inPath);
658 if (global.snd_file == 0) {
659 global. music_in = open_wave_file(gfp, inPath, &enc_delay, &enc_padding);
662 initPcmBuffer(&global.pcm32, sizeof(int));
663 initPcmBuffer(&global.pcm16, sizeof(short));
668 unsigned long const discard = global.pcm32.skip_start + global.pcm32.skip_end;
672 return (global.snd_file != NULL || global.music_in != NULL) ? 1 : -1;
678 return global.pcm32.skip_start;
684 return global.pcm32.skip_end;
691 if (global.hip != 0) {
692 hip_decode_exit(global.hip); /* release mp3decoder memory */
693 global. hip = 0;
696 close_input_file(global.music_in);
698 if (global.snd_file) {
699 if (sf_close(global.snd_file) != 0) {
704 global. snd_file = 0;
707 freePcmBuffer(&global.pcm32);
708 freePcmBuffer(&global.pcm16);
709 global. music_in = 0;
710 free(global.in_id3v2_tag);
711 global.in_id3v2_tag = 0;
712 global.in_id3v2_size = 0;
734 used = addPcmBuffer(&global.pcm32, buffer[0], buffer[1], read);
740 return takePcmBuffer(&global.pcm32, buffer[0], buffer[1], used, 1152);
742 return takePcmBuffer(&global.pcm32, buffer[1], buffer[0], used, 1152);
755 used = addPcmBuffer(&global.pcm16, buffer[0], buffer[1], read);
761 return takePcmBuffer(&global.pcm16, buffer[0], buffer[1], used, 1152);
763 return takePcmBuffer(&global.pcm16, buffer[1], buffer[0], used, 1152);
809 if (global.count_samples_carefully) {
818 if (global.num_samples_read < tmp_num_samples) {
819 remaining = tmp_num_samples - global.num_samples_read;
834 samples_read = read_samples_mp3(gfp, global.music_in, buf_tmp16);
836 samples_read = read_samples_mp3(gfp, global.music_in, buffer16);
843 if (global.snd_file) {
845 samples_read = sf_read_int(global.snd_file, insamp, num_channels * samples_to_read);
852 read_samples_pcm(global.music_in, insamp, num_channels * samples_to_read);
913 if (global.count_samples_carefully)
914 global. num_samples_read += samples_read;
936 out = mpg123_decode_frame(global.hip->mh, NULL, (unsigned char**)&outbuf, &outbytes);
958 if(global.hip->pinfo)
959 hip_finish_pinfo(global.hip);
1259 global. pcmbitwidth = 32;
1336 if (global.pcm_is_ieee_float) {
1380 int bytes_per_sample = global.pcmbitwidth / 8;
1383 switch (global.pcmbitwidth) {
1394 if (global.pcmswapbytes) {
1400 swap_byte_order = global.pcm_is_unsigned_8bit;
1565 global. pcmbitwidth = ui16_wBitsPerSample;
1566 global. pcm_is_unsigned_8bit = 1;
1567 global. pcm_is_ieee_float = (ui16_wFormatTag == WAVE_FORMAT_IEEE_FLOAT ? 1 : 0);
1726 global. pcm_is_ieee_float = 0;
1727 global. pcmswapbytes = global_reader.swapbytes;
1730 global. pcm_is_ieee_float = 0;
1731 global. pcmswapbytes = !global_reader.swapbytes;
1734 global. pcm_is_ieee_float = 0;
1735 global. pcmswapbytes = !global_reader.swapbytes;
1738 global. pcm_is_ieee_float = 1;
1739 global. pcmswapbytes = !global_reader.swapbytes;
1743 global. pcm_is_ieee_float = 1;
1744 global. pcmswapbytes = !global_reader.swapbytes;
1761 global. pcmbitwidth = aiff_info.sampleSize;
1762 global. pcm_is_unsigned_8bit = 0;
1801 global. count_samples_carefully = 0;
1802 global. pcm_is_unsigned_8bit = global_raw_pcm.in_signed == 1 ? 0 : 1;
1812 global. count_samples_carefully = 1;
1818 global. count_samples_carefully = 0;
1822 global. count_samples_carefully = 1;
1835 global. count_samples_carefully = 1;
1920 global. pcmswapbytes = global_reader.swapbytes;
1943 global. count_samples_carefully = 0;
1997 global. count_samples_carefully = 0;
2131 if (global.hip) {
2132 hip_decode_exit(global.hip);
2134 global. hip = hip_decode_init();
2135 if(!global.hip->mh)
2139 mpg123_param(global.hip->mh, MPG123_ADD_FLAGS, MPG123_STORE_RAW_ID3, 0.);
2140 mpg123_param(global.hip->mh, MPG123_ADD_FLAGS, MPG123_QUIET, 0.);
2141 mpg123_format_none(global.hip->mh);
2143 CHECK123(mpg123_format2(global.hip->mh,
2152 CHECK123(mpg123_replace_reader_handle(global.hip->mh, lame123_read_from_file, lame123_seek_in_file, lame123_cleanup_file));
2153 CHECK123(mpg123_open_handle(global.hip->mh, fd));
2155 CHECK123(mpg123_open_fd(global.hip->mh, fileno(fd)));
2158 CHECK123(mpg123_seek(global.hip->mh, SEEK_SET, 0));
2163 len = mpg123_framelength(global.hip->mh);
2168 len = mpg123_length(global.hip->mh);
2175 mpg123_getstate(global.hip->mh, MPG123_ENC_DELAY, &val, NULL);
2177 mpg123_getstate(global.hip->mh, MPG123_ENC_PADDING, &val, NULL);
2179 if(global.in_id3v2_tag)
2180 free(global.in_id3v2_tag);
2181 global.in_id3v2_size = 0;
2182 if( MPG123_OK == mpg123_id3_raw(global.hip->mh, NULL, NULL,
2184 global.in_id3v2_tag = malloc(id3size);
2185 if(global.in_id3v2_tag) {
2186 memcpy(global.in_id3v2_tag, id3buf, id3size);
2187 global.in_id3v2_size = id3size;
2190 CHECK123(mpg123_info(global.hip->mh, &fi));
2191 CHECK123(mpg123_getformat(global.hip->mh, &rate, &channels, NULL));
2198 mp3data->framesize = mpg123_spf(global.hip->mh);
2230 if (global.hip) {
2231 hip_decode_exit(global.hip);
2233 global. hip = hip_decode_init();
2234 hip_set_msgf(global.hip, global_ui_config.silent < 10 ? &frontend_msgf : 0);
2235 hip_set_errorf(global.hip, global_ui_config.silent < 10 ? &frontend_errorf : 0);
2236 hip_set_debugf(global.hip, &frontend_debugf);
2246 if (global.in_id3v2_size < 1) {
2247 global.in_id3v2_size = 10 + len;
2248 global.in_id3v2_tag = malloc(global.in_id3v2_size);
2249 if (global.in_id3v2_tag) {
2250 memcpy(global.in_id3v2_tag, buf, 10);
2251 if (fread(&global.in_id3v2_tag[10], 1, len, fd) != len)
2256 global.in_id3v2_size = 0;
2304 ret = hip_decode1_headersB(global.hip, buf, len, pcm_l, pcm_r, mp3data, enc_delay, enc_padding);
2314 hip_decode1_headersB(global.hip, buf, len, pcm_l, pcm_r, mp3data, enc_delay,
2370 ret = hip_decode1_headers(global.hip, buf, len, pcm_l, pcm_r, mp3data);
2380 ret = hip_decode1_headers(global.hip, buf, len, pcm_l, pcm_r, mp3data);
2387 ret = hip_decode1_headers(global.hip, buf, len, pcm_l, pcm_r, mp3data);
2480 return global.hip;
2487 return global.in_id3v2_size;
2494 return global.in_id3v2_tag;