Mercurial > audlegacy-plugins
comparison src/mpg123/mpg123.c @ 469:1256144d2a6e trunk
[svn] - fix crash
- finish shout metadata support
author | nenolod |
---|---|
date | Sun, 21 Jan 2007 02:09:42 -0800 |
parents | a3bf53abebf5 |
children | 220515815cf8 |
comparison
equal
deleted
inserted
replaced
468:2e4d10f3f9cb | 469:1256144d2a6e |
---|---|
669 | 669 |
670 | 670 |
671 static void * | 671 static void * |
672 decode_loop(void *arg) | 672 decode_loop(void *arg) |
673 { | 673 { |
674 static gchar *old_title = NULL; | |
674 gboolean have_xing_header = FALSE, vbr = FALSE; | 675 gboolean have_xing_header = FALSE, vbr = FALSE; |
675 int disp_count = 0; | 676 int disp_count = 0; |
676 char *filename = arg; | 677 char *filename = arg; |
677 xing_header_t xing_header; | 678 xing_header_t xing_header; |
678 | 679 |
759 mpgdec_title = get_song_title(tuple); | 760 mpgdec_title = get_song_title(tuple); |
760 bmp_title_input_free(tuple); | 761 bmp_title_input_free(tuple); |
761 } | 762 } |
762 } | 763 } |
763 else { | 764 else { |
764 mpgdec_title = mpgdec_metadata("stream-name"); | 765 gchar *tmp = mpgdec_metadata("stream-name"); |
766 old_title = mpgdec_metadata("track-name"); | |
767 | |
768 if (old_title != NULL) | |
769 { | |
770 mpgdec_title = g_strdup_printf("%s (%s)", old_title, tmp); | |
771 g_free(tmp); | |
772 } | |
773 else | |
774 mpgdec_title = tmp; | |
775 | |
765 mpgdec_length = -1; | 776 mpgdec_length = -1; |
766 } | 777 } |
767 | 778 |
768 set_synth_functions(&fr); | 779 set_synth_functions(&fr); |
769 mpgdec_init_layer3(fr.down_sample_sblimit); | 780 mpgdec_init_layer3(fr.down_sample_sblimit); |
846 } | 857 } |
847 mpgdec_ip.set_info(mpgdec_title, mpgdec_length, | 858 mpgdec_ip.set_info(mpgdec_title, mpgdec_length, |
848 mpgdec_bitrate * 1000, | 859 mpgdec_bitrate * 1000, |
849 mpgdec_frequency, mpgdec_stereo); | 860 mpgdec_frequency, mpgdec_stereo); |
850 } | 861 } |
862 | |
851 } | 863 } |
852 else | 864 else |
853 disp_count--; | 865 disp_count--; |
854 play_frame(&fr); | 866 play_frame(&fr); |
867 | |
868 { | |
869 gchar *new_title = mpgdec_metadata("track-name"); | |
870 gchar *srv_name = mpgdec_metadata("stream-name"); | |
871 | |
872 if (old_title == NULL || g_strcasecmp(old_title, new_title)) | |
873 { | |
874 g_free(mpgdec_title); | |
875 mpgdec_title = g_strdup_printf("%s (%s)", | |
876 new_title, srv_name); | |
877 | |
878 g_free(old_title); | |
879 old_title = new_title; | |
880 | |
881 g_free(srv_name); | |
882 | |
883 mpgdec_ip.set_info(mpgdec_title, mpgdec_length, | |
884 mpgdec_bitrate * 1000, | |
885 mpgdec_frequency, mpgdec_stereo); | |
886 } | |
887 } | |
855 } | 888 } |
856 else { | 889 else { |
857 mpgdec_ip.output->buffer_free(); | 890 mpgdec_ip.output->buffer_free(); |
858 mpgdec_ip.output->buffer_free(); | 891 mpgdec_ip.output->buffer_free(); |
859 mpgdec_info->eof = TRUE; | 892 mpgdec_info->eof = TRUE; |
863 else { | 896 else { |
864 g_usleep(10000); | 897 g_usleep(10000); |
865 } | 898 } |
866 } | 899 } |
867 g_free(mpgdec_title); | 900 g_free(mpgdec_title); |
901 | |
902 if (old_title != NULL) | |
903 g_free(old_title); | |
904 | |
905 old_title = NULL; | |
868 mpgdec_title = NULL; | 906 mpgdec_title = NULL; |
869 mpgdec_stream_close(); | 907 mpgdec_stream_close(); |
870 if (output_opened && !audio_error) | 908 if (output_opened && !audio_error) |
871 mpgdec_ip.output->close_audio(); | 909 mpgdec_ip.output->close_audio(); |
872 g_free(mpgdec_pcm_sample); | 910 g_free(mpgdec_pcm_sample); |