Browse Source

fixed broken CD reader code on linux; added support for broadcasting in DatagramSockets; small fix for String::replaceSection

tags/2021-05-28
jules 16 years ago
parent
commit
23e9ed57cb
2 changed files with 12 additions and 11 deletions
  1. +1
    -1
      build/win32/vc8/JUCE.vcproj
  2. +11
    -10
      juce_amalgamated.cpp

+ 1
- 1
build/win32/vc8/JUCE.vcproj View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Version="8.00"
Name="JUCE"
ProjectGUID="{AE232C11-D91C-4CA1-B24E-8B11A52EFF26}"
RootNamespace="JUCE"


+ 11
- 10
juce_amalgamated.cpp View File

@@ -7315,21 +7315,20 @@ static void initWin32Sockets()

static bool resetSocketOptions (const int handle, const bool isDatagram) throw()
{
if (handle <= 0)
return false;

const int sndBufSize = 65536;
const int rcvBufSize = 65536;
const int one = 1;

return setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (int)) == 0
&& setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (int)) == 0
&& (isDatagram || (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (int)) == 0));
return handle > 0
&& setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (rcvBufSize)) == 0
&& setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (sndBufSize)) == 0
&& (isDatagram ? (setsockopt (handle, SOL_SOCKET, SO_BROADCAST, (const char*) &one, sizeof (one)) == 0)
: (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (one)) == 0));
}

static bool bindSocketToPort (const int handle, const int port) throw()
{
if (handle == 0 || port <= 0)
if (handle <= 0 || port <= 0)
return false;

struct sockaddr_in servTmpAddr;
@@ -11590,6 +11589,9 @@ const String String::replaceSection (int index,
const int newStringLen = (stringToInsert != 0) ? CharacterFunctions::length (stringToInsert) : 0;
const int newTotalLen = len + newStringLen - numCharsToReplace;

if (newTotalLen <= 0)
return String::empty;

String result (newTotalLen, (int) 0);

memcpy (result.text->text,
@@ -259976,9 +259978,8 @@ void AudioCDReader::refreshTrackLengths()
{
}

bool AudioCDReader::read (int** destSamples,
int64 startSampleInFile,
int numSamples)
bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
{
return false;
}


Loading…
Cancel
Save