aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-01-11 03:27:40 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-01-11 03:27:40 +0000
commitc1a89635c888f21203db62021cb30333d5d80a47 (patch)
treec12a66edd9cf937aec834ae84b2f5469f9c7de2e /Game/Code/Classes
parent9ddb8c2b7c851d82922342ee8873267f0f1ae310 (diff)
downloadusdx-c1a89635c888f21203db62021cb30333d5d80a47.tar.gz
usdx-c1a89635c888f21203db62021cb30333d5d80a47.tar.xz
usdx-c1a89635c888f21203db62021cb30333d5d80a47.zip
some minor changes
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@780 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Classes/UAudioDecoder_FFMpeg.pas10
-rw-r--r--Game/Code/Classes/UAudioPlayback_Portaudio.pas6
2 files changed, 13 insertions, 3 deletions
diff --git a/Game/Code/Classes/UAudioDecoder_FFMpeg.pas b/Game/Code/Classes/UAudioDecoder_FFMpeg.pas
index c81e4be1..7ea9dd6a 100644
--- a/Game/Code/Classes/UAudioDecoder_FFMpeg.pas
+++ b/Game/Code/Classes/UAudioDecoder_FFMpeg.pas
@@ -271,6 +271,7 @@ var
stream: TFFMpegDecodeStream;
seekTarget: int64;
eofState: boolean;
+ pbIOCtx: PByteIOContext;
begin
stream := TFFMpegDecodeStream(streamPtr);
eofState := false;
@@ -333,14 +334,19 @@ begin
if(av_read_frame(stream.pFormatCtx, packet) < 0) then
begin
// check for end-of-file (eof is not an error)
- if(url_feof(@stream.pFormatCtx^.pb) <> 0) then
+ {$IF (LIBAVFORMAT_VERSION >= 52)}
+ pbIOCtx := stream.pFormatCtx^.pb;
+ {$ELSE}
+ pbIOCtx := @stream.pFormatCtx^.pb;
+ {$IFEND}
+ if(url_feof(pbIOCtx) <> 0) then
begin
eofState := true;
continue;
end;
// check for errors
- if(url_ferror(@stream.pFormatCtx^.pb) = 0) then
+ if(url_ferror(pbIOCtx) = 0) then
begin
// no error -> wait for user input
SDL_Delay(100);
diff --git a/Game/Code/Classes/UAudioPlayback_Portaudio.pas b/Game/Code/Classes/UAudioPlayback_Portaudio.pas
index c1abd0eb..5f4a8cde 100644
--- a/Game/Code/Classes/UAudioPlayback_Portaudio.pas
+++ b/Game/Code/Classes/UAudioPlayback_Portaudio.pas
@@ -226,7 +226,7 @@ begin
decodeStream.Position := 0;
end;
status := sPlaying;
- mixerStream.AddStream(Self);
+ //mixerStream.AddStream(Self);
end;
procedure TPortaudioPlaybackStream.Pause();
@@ -444,6 +444,8 @@ var
begin
decodeStream := AudioDecoder.Open(Filename);
MusicStream := TPortaudioPlaybackStream.Create(decodeStream);
+ // FIXME: remove this line
+ mixerStream.AddStream(MusicStream);
if(MusicStream.IsLoaded()) then
begin
@@ -619,6 +621,8 @@ begin
end;
playbackStream := TPortaudioPlaybackStream.Create(decodeStream);
+ // FIXME: remove this line
+ mixerStream.AddStream(playbackStream);
//Add CustomSound
csIndex := High(CustomSounds) + 1;