aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/UltraStar.lpr
diff options
context:
space:
mode:
authorjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-11 08:11:47 +0000
committerjaybinks <jaybinks@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-10-11 08:11:47 +0000
commitd123263213fba448d5695df35660f7de4cbed433 (patch)
treeef0bb01727be4b38a44a84ef6bef8224ee38d9b2 /Game/Code/UltraStar.lpr
parent48676faa6c0da1eb77999512322896840ea13cb1 (diff)
downloadusdx-d123263213fba448d5695df35660f7de4cbed433.tar.gz
usdx-d123263213fba448d5695df35660f7de4cbed433.tar.xz
usdx-d123263213fba448d5695df35660f7de4cbed433.zip
modified UTime to utilise SDL timer...
this allows for reliable cross platform timers. Tested working on linux. Modified UVideo and screens to get Video playback working on linux currently only video stream... no audio.. but I Will be working towards this, for all audio playback ( at least for linux ) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@501 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/UltraStar.lpr53
1 files changed, 53 insertions, 0 deletions
diff --git a/Game/Code/UltraStar.lpr b/Game/Code/UltraStar.lpr
index e0b1e95a..b9430a82 100644
--- a/Game/Code/UltraStar.lpr
+++ b/Game/Code/UltraStar.lpr
@@ -202,8 +202,61 @@ var
WndTitle: string;
hWnd: THandle;
I: Integer;
+
+ aFormatCtx : PAVFormatContext;//PAVCodecContext;
+ aCodecCtx : PAVCodecContext;
+ VideoStreamIndex,
+ AudioStreamIndex : integer;
begin
+
+
+
+(*
+
+av_register_all;
+aFormatCtx := av_alloc_format_context();
+if av_open_input_file( aFormatCtx, pchar( Paramstr(1) ), NIL, 0, NIL) = 0 then
+begin
+ if av_find_stream_info( aFormatCtx ) >= 0 then
+ begin
+ writeln('');
+ dump_format(aFormatCtx, 0, pchar( Paramstr(1) ), 0);
+ writeln('');
+
+// writeln( pchar( filename ) );
+
+// av_read_play( aFormatCtx );
+ find_stream_ids( aFormatCtx , VideoStreamIndex , AudioStreamIndex );
+
+ writeln( 'VideoStreamIndex : ' + inttostr(VideoStreamIndex) );
+ writeln( 'AudioStreamIndex : ' + inttostr(AudioStreamIndex) );
+
+ aCodecCtx := aFormatCtx.streams[ AudioStreamIndex ].codec;
+ writeln( 'Audio Codec Channels: '+ inttostr( integer( aCodecCtx.channels ) ) );
+ writeln( 'Audio Codec freq: '+ inttostr( integer( aCodecCtx.sample_rate ) ) );
+
+ wanted_spec.freq = aCodecCtx->sample_rate;
+ wanted_spec.format = AUDIO_S16SYS;
+ wanted_spec.channels = aCodecCtx->channels;
+ wanted_spec.silence = 0;
+ wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
+ wanted_spec.callback = audio_callback;
+ wanted_spec.userdata = aCodecCtx;
+
+ if(SDL_OpenAudio(&wanted_spec, aCodecCtx) < 0) then
+ begin
+ writeln( 'Could not do SDL_OpenAudio' );
+ exit;
+ end;
+
+
+ end;
+end;
+
+exit;
+*)
+
WndTitle := Version;