Fixes segfault when audio driver is not active.

This commit is contained in:
Themaister 2010-08-19 15:26:58 +02:00
parent 389ed7111e
commit 6c7e53b6ce
2 changed files with 5 additions and 2 deletions

View File

@ -27,6 +27,7 @@ ifeq ($(BUILD_OPENGL), 1)
endif endif
ifeq ($(BUILD_FILTER), 1) ifeq ($(BUILD_FILTER), 1)
OBJ += hqflt/hq.o OBJ += hqflt/hq.o
OBJ += hqflt/grayscale.o
endif endif
CFLAGS = -Wall -O3 -march=native -std=gnu99 CFLAGS = -Wall -O3 -march=native -std=gnu99

View File

@ -87,8 +87,10 @@ void set_fast_forward_button(bool new_button_state)
if (new_button_state && !old_button_state) if (new_button_state && !old_button_state)
{ {
syncing_state = !syncing_state; syncing_state = !syncing_state;
driver.video->set_nonblock_state(driver.video_data, syncing_state); if (video_active)
driver.audio->set_nonblock_state(driver.audio_data, syncing_state); driver.video->set_nonblock_state(driver.video_data, syncing_state);
if (audio_active)
driver.audio->set_nonblock_state(driver.audio_data, syncing_state);
if (syncing_state) if (syncing_state)
audio_chunk_size = AUDIO_CHUNK_SIZE_NONBLOCKING; audio_chunk_size = AUDIO_CHUNK_SIZE_NONBLOCKING;
else else