Mercurial > audlegacy
comparison src/audlegacy/playback.c @ 4831:ef9ddc81c51c
Patch from John Lindgren <john.lindgren@tds.net> to support seeking whilst paused, Debian bug #517692.
author | Tony Vroon <chainsaw@gentoo.org> |
---|---|
date | Wed, 04 Mar 2009 12:44:30 +0000 |
parents | 7bf7f83a217e |
children |
comparison
equal
deleted
inserted
replaced
4830:901cd268f0ca | 4831:ef9ddc81c51c |
---|---|
437 | 437 |
438 void | 438 void |
439 playback_seek(gint time) | 439 playback_seek(gint time) |
440 { | 440 { |
441 InputPlayback *playback = get_current_input_playback(); | 441 InputPlayback *playback = get_current_input_playback(); |
442 gboolean restore_pause = FALSE; | |
443 gint l=0, r=0; | |
444 | 442 |
445 g_return_if_fail(ip_data.playing); | 443 g_return_if_fail(ip_data.playing); |
446 g_return_if_fail(playback != NULL); | 444 g_return_if_fail(playback != NULL); |
447 | 445 |
448 /* FIXME WORKAROUND...that should work with all plugins | |
449 * mute the volume, start playback again, do the seek, then pause again | |
450 * -Patrick Sudowe | |
451 */ | |
452 if (ip_data.paused) | |
453 { | |
454 restore_pause = TRUE; | |
455 output_get_volume(&l, &r); | |
456 output_set_volume(0,0); | |
457 playback_pause(); | |
458 } | |
459 | |
460 plugin_set_current((Plugin *)(playback->plugin)); | 446 plugin_set_current((Plugin *)(playback->plugin)); |
461 playback->plugin->seek(playback, time); | 447 playback->plugin->seek(playback, time); |
462 playback->set_pb_change(playback); | 448 playback->set_pb_change(playback); |
463 | |
464 if (restore_pause) | |
465 { | |
466 playback_pause(); | |
467 output_set_volume(l, r); | |
468 } | |
469 | 449 |
470 event_queue_timed(100, "playback seek", playback); | 450 event_queue_timed(100, "playback seek", playback); |
471 } | 451 } |
472 | 452 |
473 void | 453 void |