diff options
author | 2010-10-01 11:05:37 +0000 | |
---|---|---|
committer | 2010-10-01 11:05:37 +0000 | |
commit | 0e06b974ec4c4d0d4cba00302c602b63d53bc3be (patch) | |
tree | d034fb533e08dc9051a2f619673f9b8f1cdcc9ee /src/emu | |
parent | 515f1746599d27f625f11337cd12fd7822a1c93a (diff) |
Adjustments to allow selecting the sample rate of WAV and AVI file writes even if -nosound is selected.
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/sound.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/emu/sound.c b/src/emu/sound.c index 8ab1d64f022..64209213d4f 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -124,12 +124,17 @@ void sound_init(running_machine *machine) { sound_private *global; const char *filename; + const char *filenameavi; machine->sound_data = global = auto_alloc_clear(machine, sound_private); - /* handle -nosound */ + /* get filename for WAV file or AVI file if specified */ + filename = options_get_string(machine->options(), OPTION_WAVWRITE); + filenameavi = options_get_string(machine->options(), OPTION_AVIWRITE); + + /* handle -nosound and lower sample rate if not recording WAV or AVI*/ global->nosound_mode = !options_get_bool(machine->options(), OPTION_SOUND); - if (global->nosound_mode) + if (global->nosound_mode && filename[0] == 0 && filenameavi[0] == 0) machine->sample_rate = 11025; /* count the speakers */ @@ -145,7 +150,6 @@ void sound_init(running_machine *machine) timer_adjust_periodic(global->update_timer, STREAMS_UPDATE_ATTOTIME, 0, STREAMS_UPDATE_ATTOTIME); /* open the output WAV file if specified */ - filename = options_get_string(machine->options(), OPTION_WAVWRITE); if (filename[0] != 0) global->wavfile = wav_open(filename, machine->sample_rate, 2); |