From: Conrad P. <co...@ve...> - 2000-10-28 07:41:19
|
On Thu, Oct 26, 2000 at 06:09:59PM +0100, Darragh O'brien - Sun Microsystems Ireland - Desktop Applications Do100715 Middleware - Software Engineer wrote: > > Here's a tentative fix for the problems with stop and play marker > movement. The fix for stop is Solaris-only, I'm not familiar with > ioctls for ALSA and OSS but those who are can add them. See the > comments I added to bug 117592 for more info on this. I added a > timeout to handle play marker updates. great, I've patched this in pretty much as is. The Solaris specific stuff has gone straight in. The change from using gtk_idle to gtk_timeout for the playmarker is way cool. There's a problem with the following few lines: > *************** > *** 79,84 **** > --- 81,89 ---- > sw_sample * s = (sw_sample *)data; > > if (s == playing) { > + > + playoffset = playoffset + ((gfloat)s->sounddata->format->rate * 0.1); > + > sample_set_playmarker (s, playoffset); > return TRUE; > } else { it adds to the playoffset (I assume to compensate for lag in the buffers) but it adds 1/10th of a second every time the update function is called, whilst play_view() is simultaneously incrementing playoffset. The result is that playoffset grows way too fast -- eg. if you play a selection with this code, the red line often moves outside that selection. We really should be getting the playback position more accurately instead of hacking this in :) I looked at the corresponding OSS ioctls for the flush/drain stuff. I _think_ OSS's SNDCTL_DSP_RESET does what Solaris' I_FLUSH, FLUSHW does ie. stop playback immediately, flushing the playback buffer. But if I move the DSP_RESET from reset() to flush() in driver.c, it creates wierd freezing problems. If you're getting similar problems on Solaris you might want to move the ioctl (the play functions here call reset() just after WAIT_FOR_PLAYING, whereas flush() is called before). Anyway .. this bug ain't closed yet, at least not for OSS :) Conrad. |