2009-12-14 Yavor Doganov
Fix FTBFS and adopt to the slightly changed avifile API.
* Bundles/WindowsMedia.CWMFile.h (WMStreamReadFrames): Typo fix.
* Bundles/WindowsMedia/CWMFile.cpp: Include .
(WMFileAudioStreamCount, WMStreamGetFrameSize): Cast the
result to unsigned int.
(WMStreamReadFrames) <_samplesRead, _bytesRead>: Declare of
type size_t. Amend the call to readStream->ReadFrames
accordingly.
--- cynthiune.app-0.9.5.orig/Bundles/WindowsMedia/CWMFile.cpp
+++ cynthiune.app-0.9.5/Bundles/WindowsMedia/CWMFile.cpp
@@ -26,6 +26,7 @@
#include
#include
+#include
#include "CWMFile.h"
@@ -74,7 +75,7 @@
readFile = (avm::IReadFile *) file;
- return readFile->AudioStreamCount ();
+ return (unsigned int) readFile->AudioStreamCount ();
}
WMStream *
@@ -117,7 +118,7 @@
readStream = (avm::IReadStream *) stream;
- return readStream->GetFrameSize ();
+ return (unsigned int) readStream->GetFrameSize ();
}
void
@@ -127,7 +128,7 @@
unsigned int *duration)
{
avm::IReadStream *readStream;
- StreamInfo *streamInfo;
+ avm::StreamInfo *streamInfo;
readStream = (avm::IReadStream *) stream;
streamInfo = readStream->GetStreamInfo ();
@@ -145,7 +146,7 @@
unsigned int samples, unsigned int *samplesRead,
unsigned int *bytesRead)
{
- unsigned int _samplesRead, _bytesRead;
+ size_t _samplesRead, _bytesRead;
avm::IReadStream *readStream;
int result, eof;
@@ -157,10 +158,13 @@
readStream = (avm::IReadStream *) stream;
while (!result && !_bytesRead)
- result = ((readStream->Eof ())
+ {
+ size_t tmp_bufferSize = (size_t) bufferSize;
+ result = ((readStream->Eof ())
? -1
- : readStream->ReadFrames (buffer, bufferSize, bufferSize,
- _samplesRead, _bytesRead));
+ : readStream->ReadFrames (buffer, tmp_bufferSize, tmp_bufferSize,
+ _samplesRead, _bytesRead));
+ }
*samplesRead = _samplesRead;
*bytesRead = _bytesRead;
--- cynthiune.app-0.9.5.orig/Bundles/WindowsMedia/CWMFile.h
+++ cynthiune.app-0.9.5/Bundles/WindowsMedia/CWMFile.h
@@ -47,7 +47,7 @@
unsigned int *duration);
int WMStreamReadFrames (WMStream *stream,
void *buffer, unsigned int bufferSize,
- unsigned int samples, unsigned *samplesRead,
+ unsigned int samples, unsigned int *samplesRead,
unsigned int *bytesRead);
void WMStreamSeekTime (WMStream *stream, unsigned int position);