comparison src/adplug/adplug-xmms.cc @ 1410:cc6203a8cc9f

Switched to new threading model
author Christian Birchinger <joker@netswarm.net>
date Mon, 06 Aug 2007 00:58:12 +0200
parents 761e17b23e0c
children 195b5657303e
comparison
equal deleted inserted replaced
1409:32aaec642cf8 1410:cc6203a8cc9f
722 VFSFile *fd = vfs_buffered_file_new_from_uri (playback->filename); 722 VFSFile *fd = vfs_buffered_file_new_from_uri (playback->filename);
723 723
724 if (!fd) 724 if (!fd)
725 { 725 {
726 plr.playing = false; 726 plr.playing = false;
727 g_thread_exit (NULL); 727 return (NULL);
728 } 728 }
729 729
730 // Try to load module 730 // Try to load module
731 dbg_printf ("factory, "); 731 dbg_printf ("factory, ");
732 if (!(plr.p = factory (fd, &opl))) 732 if (!(plr.p = factory (fd, &opl)))
733 { 733 {
734 dbg_printf ("error!\n"); 734 dbg_printf ("error!\n");
735 // MessageBox("AdPlug :: Error", "File could not be opened!", "Ok"); 735 // MessageBox("AdPlug :: Error", "File could not be opened!", "Ok");
736 plr.playing = false; 736 plr.playing = false;
737 g_thread_exit (NULL); 737 return (NULL);
738 } 738 }
739 739
740 // Cache song length 740 // Cache song length
741 dbg_printf ("length, "); 741 dbg_printf ("length, ");
742 plr.songlength = plr.p->songlength (plr.subsong); 742 plr.songlength = plr.p->songlength (plr.subsong);
849 } 849 }
850 free (sndbuf); 850 free (sndbuf);
851 plr.playing = false; // important! XMMS won't get a self-ended song without it. 851 plr.playing = false; // important! XMMS won't get a self-ended song without it.
852 dbg_printf (".\n"); 852 dbg_printf (".\n");
853 vfs_fclose (fd); 853 vfs_fclose (fd);
854 g_thread_exit (NULL);
855 return (NULL); 854 return (NULL);
856 } 855 }
857 856
858 // sampsize macro not useful anymore. 857 // sampsize macro not useful anymore.
859 #undef sampsize 858 #undef sampsize
985 dbg_printf ("init, "); 984 dbg_printf ("init, ");
986 plr.playing = true; 985 plr.playing = true;
987 plr.time_ms = 0.0f; 986 plr.time_ms = 0.0f;
988 plr.seek = -1; 987 plr.seek = -1;
989 988
990 // start player thread 989 // start player func
991 dbg_printf ("create"); 990 dbg_printf ("play");
992 plr.play_thread = g_thread_create (play_loop, playback, TRUE, NULL); 991 plr.play_thread = g_thread_self();
992 play_loop(playback);
993 dbg_printf (".\n"); 993 dbg_printf (".\n");
994 } 994 }
995 995
996 static void 996 static void
997 adplug_stop (InputPlayback * playback) 997 adplug_stop (InputPlayback * playback)