# HG changeset patch # User Stepan777 # Date 1341739272 -14400 # Node ID 46921fbe76d35f1197a5edf1bc86532d6d0e27d3 # Parent ad3f5f2e6ea994babd1c60c11e238e19ccbc0e13 Move SDL_GetTicks() to another place, maybe this will fix sound desync. Also, ensure that thumbnail is aslways saved. diff -r ad3f5f2e6ea9 -r 46921fbe76d3 hedgewars/uVideoRec.pas --- a/hedgewars/uVideoRec.pas Sun Jul 08 13:18:52 2012 +0400 +++ b/hedgewars/uVideoRec.pas Sun Jul 08 13:21:12 2012 +0400 @@ -248,12 +248,9 @@ AddFileLog('BeginPreRecording'); numFrames:= 0; - startTime:= SDL_GetTicks(); - + thumbnailSaved:= false; RecPrefix:= FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()); - thumbnailSaved:= false; - Mix_QuerySpec(@frequency, @format, @channels); AddFileLog('sound: frequency = ' + IntToStr(frequency) + ', format = ' + IntToStr(format) + ', channels = ' + IntToStr(channels)); if format <> $8010 then @@ -284,6 +281,7 @@ exit; end; + // save audio parameters in sound file BlockWrite(audioFile, frequency, 4); BlockWrite(audioFile, channels, 4); {$IOCHECKS ON} @@ -291,6 +289,7 @@ // register callback for actual audio recording Mix_SetPostMix(@RecordPostMix, nil); + startTime:= SDL_GetTicks(); flagPrerecording:= true; end; @@ -305,6 +304,9 @@ Close(cameraFile); Mix_SetPostMix(nil, nil); SDL_UnlockAudio(); + + if not thumbnailSaved then + SaveThumbnail(); end; procedure SaveCameraPosition;