Mercurial > audlegacy-plugins
diff src/cue/cuesheet.c @ 853:def1af87ae1f trunk
[svn] - add 1sec guard time after issue of playlist_prev/next.
- some tweeks on debug printouts.
author | yaz |
---|---|
date | Wed, 14 Mar 2007 06:43:19 -0700 |
parents | 2452835bbfcf |
children | 301d03667d2f |
line wrap: on
line diff
--- a/src/cue/cuesheet.c Wed Mar 14 06:07:57 2007 -0700 +++ b/src/cue/cuesheet.c Wed Mar 14 06:43:19 2007 -0700 @@ -311,7 +311,9 @@ #endif if (real_ip != NULL) real_ip->plugin->stop(real_ip); - +#ifdef DEBUG + g_print("i: stop(real_ip) finished\n"); +#endif if (data != NULL) data->playing = 0; if (caller_ip != NULL) @@ -467,8 +469,9 @@ watchdog_state = RUN; g_mutex_unlock(cue_mutex); g_cond_signal(cue_cond); +#ifdef DEBUG g_print("watchdog activated\n"); - +#endif // in some plugins, NULL as 2nd arg causes crash. real_ip->plugin->get_song_info(cue_file, &dummy, &file_length); g_free(dummy); @@ -516,7 +519,7 @@ #endif while(1) { -#if 1 +#if 0 #if DEBUG g_print("time = %d cur = %d cidx = %d nidx = %d last = %d\n", time, cur_cue_track, @@ -556,6 +559,7 @@ if(time == 0) continue; +#if 0 #ifdef DEBUG if(real_ip) { g_print("real_ip->playing = %d\n", real_ip->playing); @@ -565,7 +569,7 @@ g_print("not buffer_playing\n"); } #endif - +#endif // prev track if (time < cue_tracks[cur_cue_track].index) { @@ -579,6 +583,7 @@ if (time >= cue_tracks[cur_cue_track].index) finetune_seek = time; exec_thread = g_thread_create(do_prev, NULL, FALSE, NULL); + g_usleep(1000000); // 1sec guard time } // next track @@ -597,15 +602,17 @@ if(cfg.stopaftersong) { exec_thread = g_thread_create(do_stop, (void *)real_ip, FALSE, NULL); } - else + else { exec_thread = g_thread_create(do_next, NULL, FALSE, NULL); + g_usleep(1000000); // 1sec guard time + } } // end of file if (cur_cue_track + 1 == last_cue_track && cue_tracks[cur_cue_track + 1].index - time < 500) { // difference < 500ms #ifdef DEBUG - g_print("eof reached\n"); + g_print("i: watchdog eof reached\n"); #endif exec_thread = g_thread_create(do_stop, (void *)real_ip, FALSE, NULL); }