CVS: rdesktop rdpsnd_sgi.c,1.1,1.2
Peter Åstrand <[email protected]>
| Newsgroups | gmane.network.rdesktop.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28224
Modified Files:
rdpsnd_sgi.c
Log Message:
Indent fixes.
Index: rdpsnd_sgi.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdpsnd_sgi.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** rdpsnd_sgi.c 9 Aug 2004 11:39:49 -0000 1.1
--- rdpsnd_sgi.c 9 Aug 2004 13:03:32 -0000 1.2
***************
*** 57,77 ****
wave_out_open(void)
{
! ALparamInfo pinfo;
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_open: begin\n");
#endif
! if ( alGetParamInfo(AL_DEFAULT_OUTPUT, AL_GAIN, &pinfo) < 0 )
! {
! fprintf(stderr, "wave_out_open: alGetParamInfo failed: %s\n",
! alGetErrorString(oserror()));
! }
! min_volume = alFixedToDouble(pinfo.min.ll);
! max_volume = alFixedToDouble(pinfo.max.ll);
! volume_range = (max_volume - min_volume);
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_open: minvol = %lf, maxvol= %lf, range = %lf.\n",
! min_volume, max_volume, volume_range);
#endif
--- 57,77 ----
wave_out_open(void)
{
! ALparamInfo pinfo;
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_open: begin\n");
#endif
! if (alGetParamInfo(AL_DEFAULT_OUTPUT, AL_GAIN, &pinfo) < 0)
! {
! fprintf(stderr, "wave_out_open: alGetParamInfo failed: %s\n",
! alGetErrorString(oserror()));
! }
! min_volume = alFixedToDouble(pinfo.min.ll);
! max_volume = alFixedToDouble(pinfo.max.ll);
! volume_range = (max_volume - min_volume);
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_open: minvol = %lf, maxvol= %lf, range = %lf.\n",
! min_volume, max_volume, volume_range);
#endif
***************
*** 79,97 ****
audioconfig = alNewConfig();
! if (audioconfig < 0) {
! fprintf(stderr, "wave_out_open: alNewConfig failed: %s\n",
! alGetErrorString(oserror()));
return False;
}
output_port = alOpenPort("rdpsnd", "w", 0);
! if (output_port == (ALport) 0) {
! fprintf(stderr, "wave_out_open: alOpenPort failed: %s\n",
! alGetErrorString(oserror()));
return False;
}
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_open: returning\n");
#endif
return True;
--- 79,99 ----
audioconfig = alNewConfig();
! if (audioconfig < 0)
! {
! fprintf(stderr, "wave_out_open: alNewConfig failed: %s\n",
! alGetErrorString(oserror()));
return False;
}
output_port = alOpenPort("rdpsnd", "w", 0);
! if (output_port == (ALport) 0)
! {
! fprintf(stderr, "wave_out_open: alOpenPort failed: %s\n",
! alGetErrorString(oserror()));
return False;
}
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_open: returning\n");
#endif
return True;
***************
*** 103,109 ****
/* Ack all remaining packets */
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_close: begin\n");
#endif
!
while (queue_lo != queue_hi)
{
--- 105,111 ----
/* Ack all remaining packets */
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_close: begin\n");
#endif
!
while (queue_lo != queue_hi)
{
***************
*** 112,121 ****
queue_lo = (queue_lo + 1) % MAX_QUEUE;
}
! alDiscardFrames(output_port, 0);
!
alClosePort(output_port);
alFreeConfig(audioconfig);
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_close: returning\n");
#endif
}
--- 114,123 ----
queue_lo = (queue_lo + 1) % MAX_QUEUE;
}
! alDiscardFrames(output_port, 0);
!
alClosePort(output_port);
alFreeConfig(audioconfig);
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_close: returning\n");
#endif
}
***************
*** 138,146 ****
{
int channels;
! int frameSize, channelCount;
! ALpv params;
!
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_set_format: init...\n");
#endif
/* limited support to configure an opened audio port in IRIX */
--- 140,148 ----
{
int channels;
! int frameSize, channelCount;
! ALpv params;
!
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_set_format: init...\n");
#endif
/* limited support to configure an opened audio port in IRIX */
***************
*** 152,156 ****
if (pwfx->wBitsPerSample == 8)
width = AL_SAMPLE_8;
! else if (pwfx->wBitsPerSample == 16) {
width = AL_SAMPLE_16;
/* Do we need to swap the 16bit values? (Are we BigEndian) */
--- 154,159 ----
if (pwfx->wBitsPerSample == 8)
width = AL_SAMPLE_8;
! else if (pwfx->wBitsPerSample == 16)
! {
width = AL_SAMPLE_16;
/* Do we need to swap the 16bit values? (Are we BigEndian) */
***************
*** 172,178 ****
output_port = alOpenPort("rdpsnd", "w", audioconfig);
! if (output_port == (ALport) 0) {
! fprintf(stderr, "wave_out_set_format: alOpenPort failed: %s\n",
! alGetErrorString(oserror()));
return False;
}
--- 175,182 ----
output_port = alOpenPort("rdpsnd", "w", audioconfig);
! if (output_port == (ALport) 0)
! {
! fprintf(stderr, "wave_out_set_format: alOpenPort failed: %s\n",
! alGetErrorString(oserror()));
return False;
}
***************
*** 180,210 ****
resource = alGetResource(output_port);
maxFillable = alGetFillable(output_port);
! channelCount = alGetChannels(audioconfig);
! frameSize = alGetWidth(audioconfig);
! if (frameSize == 0 || channelCount == 0)
! {
! fprintf(stderr, "wave_out_set_format: bad frameSize or channelCount\n");
! return False;
! }
! combinedFrameSize = frameSize * channelCount;
! params.param = AL_RATE;
! params.value.ll = (long long) g_snd_rate << 32;
! if (alSetParams(resource, ¶ms, 1) < 0)
! {
! fprintf(stderr, "wave_set_format: alSetParams failed: %s\n",
! alGetErrorString(oserror()));
! return False;
! }
! if( params.sizeOut < 0 )
! {
! fprintf(stderr, "wave_set_format: invalid rate %d\n", g_snd_rate);
! return False;
! }
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_set_format: returning...\n");
#endif
return True;
--- 184,214 ----
resource = alGetResource(output_port);
maxFillable = alGetFillable(output_port);
! channelCount = alGetChannels(audioconfig);
! frameSize = alGetWidth(audioconfig);
! if (frameSize == 0 || channelCount == 0)
! {
! fprintf(stderr, "wave_out_set_format: bad frameSize or channelCount\n");
! return False;
! }
! combinedFrameSize = frameSize * channelCount;
! params.param = AL_RATE;
! params.value.ll = (long long) g_snd_rate << 32;
! if (alSetParams(resource, ¶ms, 1) < 0)
! {
! fprintf(stderr, "wave_set_format: alSetParams failed: %s\n",
! alGetErrorString(oserror()));
! return False;
! }
! if (params.sizeOut < 0)
! {
! fprintf(stderr, "wave_set_format: invalid rate %d\n", g_snd_rate);
! return False;
! }
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_set_format: returning...\n");
#endif
return True;
***************
*** 214,243 ****
wave_out_volume(uint16 left, uint16 right)
{
! double gainleft, gainright;
! ALpv pv[1];
! ALfixed gain[8];
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_volume: begin\n");
! fprintf(stderr, "left='%d', right='%d'\n", left, right);
#endif
!
! gainleft = (double) left / IRIX_MAX_VOL;
gainright = (double) right / IRIX_MAX_VOL;
! gain[0] = alDoubleToFixed(min_volume + gainleft * volume_range);
! gain[1] = alDoubleToFixed(min_volume + gainright * volume_range);
! pv[0].param = AL_GAIN;
! pv[0].value.ptr = gain;
! pv[0].sizeIn = 8;
! if( alSetParams(AL_DEFAULT_OUTPUT, pv, 1) < 0)
! {
! fprintf(stderr, "wave_out_volume: alSetParams failed: %s\n", alGetErrorString(oserror()));
! return;
! }
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_volume: returning\n");
#endif
}
--- 218,248 ----
wave_out_volume(uint16 left, uint16 right)
{
! double gainleft, gainright;
! ALpv pv[1];
! ALfixed gain[8];
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_volume: begin\n");
! fprintf(stderr, "left='%d', right='%d'\n", left, right);
#endif
!
! gainleft = (double) left / IRIX_MAX_VOL;
gainright = (double) right / IRIX_MAX_VOL;
! gain[0] = alDoubleToFixed(min_volume + gainleft * volume_range);
! gain[1] = alDoubleToFixed(min_volume + gainright * volume_range);
! pv[0].param = AL_GAIN;
! pv[0].value.ptr = gain;
! pv[0].sizeIn = 8;
! if (alSetParams(AL_DEFAULT_OUTPUT, pv, 1) < 0)
! {
! fprintf(stderr, "wave_out_volume: alSetParams failed: %s\n",
! alGetErrorString(oserror()));
! return;
! }
#if (defined(IRIX_DEBUG))
! fprintf(stderr, "wave_out_volume: returning\n");
#endif
}
***************
*** 317,322 ****
len = out->end - out->p;
! gf = alGetFillable(output_port);
! if (len > gf) {
//len = gf * combinedFrameSize;
#if (defined(IRIX_DEBUG))
--- 322,328 ----
len = out->end - out->p;
! gf = alGetFillable(output_port);
! if (len > gf)
! {
//len = gf * combinedFrameSize;
#if (defined(IRIX_DEBUG))
***************
*** 325,329 ****
}
! alWriteFrames(output_port, out->p, len/combinedFrameSize);
out->p += len;
--- 331,335 ----
}
! alWriteFrames(output_port, out->p, len / combinedFrameSize);
out->p += len;
***************
*** 335,340 ****
gettimeofday(&tv, NULL);
duration = (out->size * (1000000 / (g_samplewidth * g_snd_rate)));
! elapsed = (tv.tv_sec - startedat_s) * 1000000
! + (tv.tv_usec - startedat_us);
/* 7/10 is not good for IRIX audio port, 4x/100 is suitable */
if (elapsed >= (duration * 485) / 1000)
--- 341,345 ----
gettimeofday(&tv, NULL);
duration = (out->size * (1000000 / (g_samplewidth * g_snd_rate)));
! elapsed = (tv.tv_sec - startedat_s) * 1000000 + (tv.tv_usec - startedat_us);
/* 7/10 is not good for IRIX audio port, 4x/100 is suitable */
if (elapsed >= (duration * 485) / 1000)
-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com