# HG changeset patch # User nenolod # Date 1154587330 25200 # Node ID b22164c8eb51344191632d6c93ff578ba7b3511b # Parent 5dbe7cfdcaf55216f30b3c36d40cd92fdec714ee [svn] - the other half of the equasion wrt seeking diff -r 5dbe7cfdcaf5 -r b22164c8eb51 ChangeLog --- a/ChangeLog Wed Aug 02 23:33:49 2006 -0700 +++ b/ChangeLog Wed Aug 02 23:42:10 2006 -0700 @@ -1,3 +1,12 @@ +2006-08-03 06:33:49 +0000 William Pitcock + revision [1866] + - support the notion of a watchdog function to keep things bound to the proper playlist entry. (half there) + + + Changes: Modified: + +19 -5 trunk/Plugins/Input/cue/cuesheet.c + + 2006-08-03 05:57:08 +0000 William Pitcock revision [1864] - better support cuesheets outside of your directory diff -r 5dbe7cfdcaf5 -r b22164c8eb51 Plugins/Input/cue/cuesheet.c --- a/Plugins/Input/cue/cuesheet.c Wed Aug 02 23:33:49 2006 -0700 +++ b/Plugins/Input/cue/cuesheet.c Wed Aug 02 23:42:10 2006 -0700 @@ -50,6 +50,7 @@ gint index; } cue_tracks[MAX_CUE_TRACKS]; static gint timeout_tag = 0; +static gint finetune_seek = 0; static InputPlugin *real_ip = NULL; @@ -249,7 +250,14 @@ real_ip->set_info = set_info_override; real_ip->output = cue_ip.output; real_ip->play_file(cue_file); - real_ip->seek(cue_tracks[track].index / 1000); /* XXX: seek doesn't use frames? strange... -nenolod */ + + if (finetune_seek == 0) + real_ip->seek(cue_tracks[track].index / 1000); /* XXX: seek doesn't use frames? strange... -nenolod */ + else + { + real_ip->seek(finetune_seek / 1000); + finetune_seek = 0; + } } cur_cue_track = track; @@ -269,10 +277,21 @@ { gint time = get_output_time(); + /* recurse until we're in the basically right place. */ if (time < cue_tracks[cur_cue_track].index) + { + cur_cue_track--; playlist_prev(); + watchdog_func(NULL); + } else if (cur_cue_track != last_cue_track && (time > cue_tracks[cur_cue_track + 1].index)) + { + cur_cue_track++; playlist_next(); + watchdog_func(NULL); + } + + finetune_seek = time; return TRUE; }