Patch(s) provied by Fabien Devaux

This fixes bug# 4421

http://projects.blender.org/tracker/index.php?func=detail&aid=4421&group_id=9&atid=125

Initalizes audio in scrub mode properly.
also avoids playing back some samples twice.

Kent
This commit is contained in:
2006-06-23 15:08:13 +00:00
parent 619d0dc9ca
commit 6d79aed0f2
2 changed files with 8 additions and 4 deletions

View File

@@ -90,6 +90,7 @@ void audio_fill(void *mixdown, Uint8 *sstream, int len);
static int audio_pos;
static int audio_scrub=0;
static int audio_playing=0;
static int audio_initialised=0;
/////
//
/* local protos ------------------- */
@@ -445,11 +446,12 @@ static int audio_init(SDL_AudioSpec *desired)
if (obtained) MEM_freeN(obtained);
return 0;
}
audio_initialised = 1;
hardware_spec=obtained;
MEM_freeN(obtained);
SDL_PauseAudio(1);
SDL_PauseAudio(0);
return 1;
}
@@ -510,7 +512,7 @@ void audiostream_play(Uint32 startframe, Uint32 duration, int mixdown)
sound_init_audio();
}
if (!(duration + mixdown)) {
if (!audio_initialised || !(duration + mixdown)) {
desired.freq=G.scene->audio.mixrate;
desired.format=AUDIO_S16SYS;
desired.channels=2;
@@ -520,6 +522,7 @@ void audiostream_play(Uint32 startframe, Uint32 duration, int mixdown)
U.mixbufsize = 0; /* no audio */
}
}
audio_pos = ( ((int)( (((float)startframe)
/(float)G.scene->r.frs_sec)
*(G.scene->audio.mixrate)*4 )) & (~3) );

View File

@@ -3600,7 +3600,7 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
View2D *v2d= &sseq->v2d;
Sequence *last_seq = get_last_seq();
float dx, dy;
int doredraw= 0, cfra, first;
int doredraw= 0, cfra=0, first;
short mval[2];
short nr;
short mousebut = L_MOUSE;
@@ -3652,7 +3652,8 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
set_special_seq_update(0);
update_for_newframe();
if (cfra == 0)
update_for_newframe();
}
break;
case MIDDLEMOUSE: