summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2019-06-14 13:26:18 +0000
committernia <nia@pkgsrc.org>2019-06-14 13:26:18 +0000
commit2dbc12881b497506c676c504d7aec862bdf715c5 (patch)
treeba5d23b7eb4e7c2f8bc1d3bade33524eea871cc4 /www
parentaa28e80921de7a63f8ccbd2f13949d649bda52de (diff)
downloadpkgsrc-2dbc12881b497506c676c504d7aec862bdf715c5.tar.gz
seamonkey: This gets the newer get_position too.
Diffstat (limited to 'www')
-rw-r--r--www/seamonkey/files/cubeb_sun.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/www/seamonkey/files/cubeb_sun.c b/www/seamonkey/files/cubeb_sun.c
index 37c43a607b4..8c845e3d682 100644
--- a/www/seamonkey/files/cubeb_sun.c
+++ b/www/seamonkey/files/cubeb_sun.c
@@ -98,6 +98,7 @@ struct cubeb_stream {
char input_name[32];
char output_name[32];
uint64_t frames_written;
+ uint64_t blocks_written;
};
int
@@ -664,10 +665,22 @@ sun_stream_start(cubeb_stream * s)
static int
sun_stream_get_position(cubeb_stream * s, uint64_t * position)
{
+#ifdef AUDIO_GETOOFFS
+ struct audio_offset offset;
+
+ if (ioctl(s->play_fd, AUDIO_GETOOFFS, &offset) == -1) {
+ return CUBEB_ERROR;
+ }
+ s->blocks_written += offset.deltablks;
+ *position = BYTES_TO_FRAMES(s->blocks_written * s->p_info.blocksize,
+ s->p_info.play.channels);
+ return CUBEB_OK;
+#else
pthread_mutex_lock(&s->mutex);
*position = s->frames_written;
pthread_mutex_unlock(&s->mutex);
return CUBEB_OK;
+#endif
}
static int