16#pragma function(memcpy)
18#define IX_THREAD_FILE "D:\\Rnd\\Prj\\ix\\Src\\Streamer\\thread.cpp"
98 unsigned int bytesUntilStop;
103 Sleep((bytesUntilStop * 1000U) /
126 unsigned int archiveOffset;
128 unsigned int chunkIndex;
129 unsigned int unreadChunks;
131 unsigned int offsetInPart;
132 unsigned int partDataSize;
133 unsigned char *readSource;
134 unsigned int byteCount;
135 unsigned int midpoint;
136 unsigned int firstPacket;
137 unsigned int *selectedPacket;
138 unsigned int endPacket;
140 directoryRecord = streamFile->
entry;
150 if (streamFile->
next == 0)
155 streamFile->
next = 0;
169 while (unreadChunks--) {
175 endPacket = sourceChunk->
packetCount + firstPacket;
178 while (endPacket > firstPacket) {
179 midpoint = (endPacket + firstPacket) >> 1;
181 if (*selectedPacket < archiveOffset)
182 firstPacket = midpoint + 1;
183 else if (*selectedPacket > archiveOffset)
184 endPacket = midpoint;
188 if (selectedPacket == 0) {
211 partDataSize = partDataSize - offsetInPart;
212 readSource += offsetInPart;
213 if (byteCount > partDataSize)
214 byteCount = partDataSize;
215 memcpy(streamFile->
destination, readSource, byteCount);
223 if (streamFile->
next == 0)
228 streamFile->
next = 0;
249 int bytesUntilRefill;
257 while (streamFile != 0) {
258 if (chosenFile != 0) {
260 chosenFile = streamFile;
262 chosenFile = streamFile;
264 chosenFile = streamFile;
281 if (bytesUntilRefill > 0) {
282 bytesUntilRefill += 0x16f8;
283 return (bytesUntilRefill * 1000U) /
294 unsigned int triggerIndex;
295 unsigned int triggerCount;
301 while (triggerCount--) {
333 unsigned int bestGap;
377 unsigned int bytesToCopy;
378 unsigned int lockedBytes;
380 unsigned int fileOffset;
383 if (bytesToCopy > 0) {
386 while (bytesToCopy > 0) {
396 bytesToCopy = bytesToCopy - lockedBytes;
397 fileOffset += lockedBytes;
407 unsigned int fileOffset;
void(__cdecl *g_pIxFree)(void *)
void ix_dsps_prepare(int stream)
void ix_dsps_unlock(int stream)
void ix_dsps_stop(int stream)
void ix_dsps_play(int stream)
int ix_dsps_get_buffer_free(int stream)
void ix_dsps_lock(int stream, unsigned int requestedBytes, unsigned char **buffer, unsigned int *lockedBytes)
unsigned int g_dwStreamerMode
Audio classes, DirectSound interfaces and shared ix state.
IxStreamerTrigger * g_6_pFeederTriggers
IxStreamerHeader * g_pStreamPrologue
unsigned int g_nStreamerBranchStackIndex
unsigned int * g_7_pStreamerPacketOffsets
void ix_thread_handle_file_chunk(IxStreamFile *streamFile)
unsigned int ix_thread_get_audio_chunk_size(void)
HANDLE g_1_hStreamRouseEvent
IxStreamFile * g_48_pPumpIdleFiles
void ix_thread_advance_audio_chunk(void)
unsigned int ix_file_read(FILE *file, void *destination, unsigned int bytes)
FILE * g_1_pFeederPackageDisk
unsigned int g_nSpoolerDiskChunk
void ix_thread_lock_stream_buffer(void)
unsigned int ix_streamer_service_audio(void)
void ix_log_printf(const char *fmt,...)
void ix_file_seek(FILE *file, long position)
CRITICAL_SECTION g_csStreamerFileFifo
long ix_file_tell(FILE *file)
unsigned int g_6_dwStreamSoundChunk
CRITICAL_SECTION g_49_csStreamWorker
DWORD WINAPI ix_streamer_thread_proc(void *parameter)
unsigned char * g_pStreamerFileStore
IxStreamFile * g_1_pPlayerReadQueue
char g_cStreamerBranchTag
unsigned char * g_126_pReaderCompressedBuf
void ix_lzo1x_decompress(unsigned char *source, unsigned char *destination, unsigned int destinationBytes)
unsigned int g_13_adwPlayerBranchingStack[32]
IxStreamerFileChunk * g_17_pStreamerFileParts
CRITICAL_SECTION g_1_csStreamer
IxStreamerBranch * g_7_pStreamBranches
unsigned int g_16_nStreamerBytesEachSecond
unsigned int ix_thread_service_streams(void)
@ IX_STREAMER_DSP_PLAYING
@ IX_STREAMER_AUDIO_PAUSED
@ IX_STREAMER_AUDIO_PLAYING
@ IX_STREAMER_THREAD_RUNNING
@ IX_STREAMER_REPREPARE_AUDIO
@ IX_STREAMER_END_TRIGGERED
IxStreamerAudioChunk * g_15_pStreamerSoundChunks
unsigned int g_18_dwStreamerThreadTick
unsigned char g_6_bFeederLevel
unsigned char * destination
IxStreamerFileEntry * entry
unsigned int triggerCount
unsigned int firstTrigger