35 |
35 |
#include "playlist.h"
|
36 |
36 |
#include "plugin.h"
|
37 |
37 |
|
|
38 |
#include <stdio.h>
|
|
39 |
|
38 |
40 |
static pthread_t playback_thread_handle;
|
39 |
41 |
static int end_source = 0;
|
40 |
42 |
|
... | ... | |
231 |
233 |
playback_error = FALSE;
|
232 |
234 |
song_finished = FALSE;
|
233 |
235 |
|
|
236 |
printf ("playback cleanup, clearing seek request\n");
|
234 |
237 |
seek_request = -1;
|
235 |
238 |
repeat_a = -1;
|
236 |
239 |
|
... | ... | |
362 |
365 |
int length = playback_entry_get_length ();
|
363 |
366 |
|
364 |
367 |
if (length < 1)
|
|
368 |
{
|
|
369 |
printf ("not seekable, clearing seek request\n");
|
365 |
370 |
seek_request = -1;
|
|
371 |
}
|
366 |
372 |
|
367 |
373 |
if (tuple && length > 0)
|
368 |
374 |
{
|
... | ... | |
370 |
376 |
{
|
371 |
377 |
time_offset = tuple_get_int (tuple, FIELD_SEGMENT_START);
|
372 |
378 |
if (time_offset)
|
|
379 |
{
|
373 |
380 |
seek_request = time_offset + MAX (seek_request, 0);
|
|
381 |
printf ("segmented track, seeking to %d\n", seek_request);
|
|
382 |
}
|
374 |
383 |
}
|
375 |
384 |
|
376 |
385 |
if (tuple_get_value_type (tuple, FIELD_SEGMENT_END) == TUPLE_INT)
|
... | ... | |
414 |
423 |
paused = pause;
|
415 |
424 |
|
416 |
425 |
seek_request = (seek_time > 0) ? seek_time : -1;
|
|
426 |
printf ("initial seek request: %d\n", seek_request);
|
417 |
427 |
|
418 |
428 |
stopped = FALSE;
|
419 |
429 |
|
... | ... | |
446 |
456 |
pthread_mutex_lock (& control_mutex);
|
447 |
457 |
|
448 |
458 |
seek_request = time_offset + CLAMP (time, 0, current_length);
|
|
459 |
printf ("aud_drct_seek requesting seek to %d\n", seek_request);
|
449 |
460 |
output_abort_write ();
|
450 |
461 |
|
451 |
462 |
pthread_mutex_unlock (& control_mutex);
|
... | ... | |
494 |
505 |
{
|
495 |
506 |
pthread_mutex_lock (& control_mutex);
|
496 |
507 |
seek_request = MAX (repeat_a, time_offset);
|
|
508 |
printf ("reached repeat point B, seeking to %d\n", seek_request);
|
497 |
509 |
pthread_mutex_unlock (& control_mutex);
|
498 |
510 |
}
|
499 |
511 |
}
|
... | ... | |
549 |
561 |
output_set_time (seek);
|
550 |
562 |
seek_request = -1;
|
551 |
563 |
|
|
564 |
printf ("handling seek request to %d\n", seek);
|
552 |
565 |
event_queue ("playback seek", NULL);
|
553 |
566 |
}
|
554 |
567 |
|
... | ... | |
639 |
652 |
if (b != -1 && output_get_time () >= b)
|
640 |
653 |
{
|
641 |
654 |
seek_request = MAX (a, time_offset);
|
|
655 |
printf ("already past repeat point B, seeking to %d\n", seek_request);
|
642 |
656 |
output_abort_write ();
|
643 |
657 |
}
|
644 |
658 |
|