head 1.4; access; symbols pkgsrc-2013Q2:1.4.0.52 pkgsrc-2013Q2-base:1.4 pkgsrc-2012Q4:1.4.0.50 pkgsrc-2012Q4-base:1.4 pkgsrc-2011Q4:1.4.0.48 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q2:1.4.0.46 pkgsrc-2011Q2-base:1.4 pkgsrc-2009Q4:1.4.0.44 pkgsrc-2009Q4-base:1.4 pkgsrc-2008Q4:1.4.0.42 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.4.0.40 pkgsrc-2008Q3-base:1.4 cube-native-xorg:1.4.0.38 cube-native-xorg-base:1.4 pkgsrc-2008Q2:1.4.0.36 pkgsrc-2008Q2-base:1.4 pkgsrc-2008Q1:1.4.0.34 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.32 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.30 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.4.0.28 pkgsrc-2007Q2-base:1.4 pkgsrc-2007Q1:1.4.0.26 pkgsrc-2007Q1-base:1.4 pkgsrc-2006Q4:1.4.0.24 pkgsrc-2006Q4-base:1.4 pkgsrc-2006Q3:1.4.0.22 pkgsrc-2006Q3-base:1.4 pkgsrc-2006Q2:1.4.0.20 pkgsrc-2006Q2-base:1.4 pkgsrc-2006Q1:1.4.0.18 pkgsrc-2006Q1-base:1.4 pkgsrc-2005Q4:1.4.0.16 pkgsrc-2005Q4-base:1.4 pkgsrc-2005Q3:1.4.0.14 pkgsrc-2005Q3-base:1.4 pkgsrc-2005Q2:1.4.0.12 pkgsrc-2005Q2-base:1.4 pkgsrc-2005Q1:1.4.0.10 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.8 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.6 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.4 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.2 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.3.0.2 pkgsrc-2003Q4-base:1.3 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.4 date 2004.01.26.13.06.14; author jmmv; state dead; branches; next 1.3; 1.3 date 2003.10.02.10.11.49; author mycroft; state Exp; branches; next 1.2; 1.2 date 2003.10.02.01.16.40; author mycroft; state Exp; branches; next 1.1; 1.1 date 2003.04.06.11.06.02; author rh; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2003.04.06.11.06.02; author rh; state Exp; branches; next ; desc @@ 1.4 log @xine-lib and xine-ui moved to the multimedia category. @ text @$NetBSD: patch-ac,v 1.3 2003/10/02 10:11:49 mycroft Exp $ --- src/audio_out/audio_sun_out.c.orig 2003-07-13 19:29:04.000000000 +0000 +++ src/audio_out/audio_sun_out.c 2003-10-02 09:51:34.000000000 +0000 @@@@ -41,6 +41,11 @@@@ #ifdef __svr4__ #include #endif +#include + +#if (defined(BSD) && BSD >= 199306) +typedef unsigned uint_t; +#endif #include "xine_internal.h" #include "xineutils.h" @@@@ -89,7 +94,9 @@@@ uint32_t num_channels; int bytes_per_frame; +#ifndef __NetBSD__ uint32_t frames_in_buffer; /* number of frames writen to audio hardware */ +#endif enum { RTSC_UNKNOWN = 0, @@@@ -113,12 +120,14 @@@@ unsigned buf_len; #endif +#ifndef __NetBSD__ #if SW_SAMPLE_COUNT struct timeval tv0; uint_t sample0; #endif uint_t last_samplecnt; +#endif } sun_driver_t; @@@@ -128,6 +137,7 @@@@ */ static int realtime_samplecounter_available(char *dev) { +#ifndef __NetBSD__ int fd = -1; audio_info_t info; int rtsc_ok = RTSC_DISABLED; @@@@ -246,6 +256,9 @@@@ } return rtsc_ok; +#else + return RTSC_ENABLED; +#endif } @@@@ -431,7 +444,9 @@@@ this->mode = mode; this->input_sample_rate = rate; +#ifndef __NetBSD__ this->frames_in_buffer = 0; +#endif /* * open audio device @@@@ -463,6 +478,9 @@@@ info.play.sample_rate = this->input_sample_rate; info.play.eof = 0; info.play.samples = 0; +#ifdef __NetBSD__ + info.blocksize = 1024; +#endif this->convert_u8_s8 = 0; @@@@ -524,7 +542,9 @@@@ return 0; } +#ifndef __NetBSD__ this->last_samplecnt = 0; +#endif this->output_sample_rate = info.play.sample_rate; this->num_channels = info.play.channels; @@@@ -566,6 +586,7 @@@@ sun_driver_t *this = (sun_driver_t *) this_gen; audio_info_t info; +#ifndef __NetBSD__ if (ioctl(this->audio_fd, AUDIO_GETINFO, &info) == 0 && (this->frames_in_buffer == 0 || info.play.samples > 0)) { @@@@ -611,6 +632,10 @@@@ } #endif } +#else + if (ioctl(this->audio_fd, AUDIO_GETINFO, &info) == 0) + return info.play.seek / this->bytes_per_frame; +#endif return NOT_REAL_TIME; } @@@@ -719,7 +744,9 @@@@ if (num_written > 0) { int buffered_samples; +#ifndef __NetBSD__ this->frames_in_buffer += num_written / this->bytes_per_frame; +#endif /* * Avoid storing too much data in the sound driver's buffers. @ 1.3 log @Better fix for audio playback -- now xine works pretty for DVD and radio playback, at least. @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.2 2003/10/02 01:16:40 mycroft Exp $ @ 1.2 log @Adjustments for NetBSD audio interface... * play.samples is in bytes, not frames. (XXX I wonder if we can fix this or it's too late??) * Set blocksize much smaller so that xine thinks the pointer is "real-time". @ text @d1 1 a1 1 $NetBSD$ d4 1 a4 1 +++ src/audio_out/audio_sun_out.c 2003-10-02 01:12:46.000000000 +0000 d17 21 a37 6 @@@@ -161,6 +166,9 @@@@ info.play.precision = AUDIO_PRECISION_16; info.play.encoding = AUDIO_ENCODING_LINEAR; info.play.samples = 0; +#ifdef __NetBSD__ + info.blocksize = 1024; d39 12 a50 6 if (ioctl(fd, AUDIO_SETINFO, &info)) { fprintf(stderr, "rtsc: SETINFO failed\n"); goto error; @@@@ -175,6 +183,9 @@@@ fprintf(stderr, "rtsc: GETINFO1, %s\n", strerror(errno)); goto error; d52 4 a55 2 +#ifdef __NetBSD__ + info.play.samples /= 4; d57 1 d59 7 a65 8 last_samplecnt = info.play.samples; min_increment = ~0; @@@@ -197,6 +208,9 @@@@ fprintf(stderr, "rtsc: GETINFO2 failed, %s\n", strerror(errno)); goto error; } +#ifdef __NetBSD__ + info.play.samples /= 4; d67 4 a70 4 if (info.play.samples < last_samplecnt) { fprintf(stderr, "rtsc: %u > %u?\n", last_samplecnt, info.play.samples); goto error; @@@@ -463,6 +477,9 @@@@ d80 7 a86 1 @@@@ -568,6 +585,9 @@@@ d88 7 d97 18 a114 2 +#ifdef __NetBSD__ + info.play.samples /= this->bytes_per_frame; d117 2 a118 2 if (info.play.samples < this->last_samplecnt) { fprintf(stderr, "audio_sun_out: broken sound driver, sample counter runs backwards, cur %u < prev %u\n", @ 1.1 log @Initial revision @ text @d3 2 a4 2 --- src/audio_out/audio_sun_out.c.orig Sat Mar 8 08:27:29 2003 +++ src/audio_out/audio_sun_out.c d17 50 @ 1.1.1.1 log @Initial import of xine-lib-1.0rc9, a multimedia player library. @ text @@