Mercurial > audlegacy
comparison Plugins/Input/mpg123/mpg123.c @ 1096:9b4e9be457f0 trunk
[svn] - remove improper sampling rate change condition. Valid MP3s will not do this. Infact, I've never seen an MP3 that does this. Additionally, it doesn't even work with Shoutcast.
author | nenolod |
---|---|
date | Mon, 22 May 2006 16:37:39 -0700 |
parents | 09eb2c83097a |
children | 03dbf5494d40 |
comparison
equal
deleted
inserted
replaced
1095:dec5caa8768b | 1096:9b4e9be457f0 |
---|---|
665 | 665 |
666 static void * | 666 static void * |
667 decode_loop(void *arg) | 667 decode_loop(void *arg) |
668 { | 668 { |
669 gboolean have_xing_header = FALSE, vbr = FALSE; | 669 gboolean have_xing_header = FALSE, vbr = FALSE; |
670 int disp_count = 0, temp_time; | 670 int disp_count = 0; |
671 char *filename = arg; | 671 char *filename = arg; |
672 xing_header_t xing_header; | 672 xing_header_t xing_header; |
673 | 673 |
674 /* This is used by fileinfo on http streams */ | 674 /* This is used by fileinfo on http streams */ |
675 mpg123_bitrate = 0; | 675 mpg123_bitrate = 0; |
784 skip_frames = 2; | 784 skip_frames = 2; |
785 mpg123_info->output_audio = FALSE; | 785 mpg123_info->output_audio = FALSE; |
786 continue; | 786 continue; |
787 } | 787 } |
788 | 788 |
789 } | |
790 } | |
791 if (mpg123_freqs[fr.sampling_frequency] != mpg123_frequency | |
792 || mpg123_stereo != fr.stereo) { | |
793 memcpy(&temp_fr, &fr, sizeof(struct frame)); | |
794 if (mpg123_read_frame(&temp_fr) != 0) { | |
795 if (fr.sampling_frequency == | |
796 temp_fr.sampling_frequency | |
797 && temp_fr.stereo == fr.stereo) { | |
798 mpg123_ip.output->buffer_free(); | |
799 mpg123_ip.output->buffer_free(); | |
800 while (mpg123_ip.output->buffer_playing() | |
801 && mpg123_info->going | |
802 && mpg123_info->jump_to_time == -1) | |
803 xmms_usleep(20000); | |
804 if (!mpg123_info->going) | |
805 break; | |
806 temp_time = mpg123_ip.output->output_time(); | |
807 mpg123_ip.output->close_audio(); | |
808 mpg123_frequency = | |
809 mpg123_freqs[fr.sampling_frequency]; | |
810 mpg123_stereo = fr.stereo; | |
811 if (!mpg123_ip.output-> | |
812 open_audio(mpg123_cfg.resolution == | |
813 16 ? FMT_S16_NE : FMT_U8, | |
814 mpg123_freqs[fr.sampling_frequency] | |
815 >> mpg123_cfg.downsample, | |
816 mpg123_cfg.channels == | |
817 2 ? fr.stereo : 1)) { | |
818 audio_error = TRUE; | |
819 mpg123_info->eof = TRUE; | |
820 } | |
821 mpg123_ip.output->flush(temp_time); | |
822 mpg123_ip.set_info(mpg123_title, mpg123_length, | |
823 mpg123_bitrate * 1000, | |
824 mpg123_frequency, | |
825 mpg123_stereo); | |
826 memcpy(&fr, &temp_fr, sizeof(struct frame)); | |
827 } | |
828 else { | |
829 memcpy(&fr, &temp_fr, sizeof(struct frame)); | |
830 skip_frames = 2; | |
831 mpg123_info->output_audio = FALSE; | |
832 continue; | |
833 } | |
834 } | 789 } |
835 } | 790 } |
836 | 791 |
837 if (tabsel_123[fr.lsf][fr.lay - 1][fr.bitrate_index] != | 792 if (tabsel_123[fr.lsf][fr.lay - 1][fr.bitrate_index] != |
838 mpg123_bitrate) | 793 mpg123_bitrate) |