summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/recording.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/recording.cpp')
-rw-r--r--src/emu/recording.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/emu/recording.cpp b/src/emu/recording.cpp
index d9c25c57767..91bc0e58bf7 100644
--- a/src/emu/recording.cpp
+++ b/src/emu/recording.cpp
@@ -146,7 +146,10 @@ movie_recording::ptr movie_recording::create(running_machine &machine, screen_de
// if we successfully create a recording, set the current time and return it
if (result)
+ {
result->set_next_frame_time(machine.time());
+ result->set_channel_count(machine.sound().outputs_count());
+ }
return result;
}
@@ -190,10 +193,12 @@ bool avi_movie_recording::initialize(running_machine &machine, std::unique_ptr<e
info.audio_timescale = machine.sample_rate();
info.audio_sampletime = 1;
info.audio_numsamples = 0;
- info.audio_channels = 2;
+ info.audio_channels = machine.sound().outputs_count();
info.audio_samplebits = 16;
info.audio_samplerate = machine.sample_rate();
+ m_channels = info.audio_channels;
+
// compute the frame time
set_frame_period(attotime::from_ticks(info.video_sampletime, info.video_timescale));
@@ -225,9 +230,9 @@ bool avi_movie_recording::add_sound_to_recording(const s16 *sound, int numsample
auto profile = g_profiler.start(PROFILER_MOVIE_REC);
// write the next frame
- avi_file::error avierr = m_avi_file->append_sound_samples(0, sound + 0, numsamples, 1);
- if (avierr == avi_file::error::NONE)
- avierr = m_avi_file->append_sound_samples(1, sound + 1, numsamples, 1);
+ avi_file::error avierr = avi_file::error::NONE;
+ for (int channel = 0; channel != m_channels && avierr == avi_file::error::NONE; channel ++)
+ avierr = m_avi_file->append_sound_samples(channel, sound + channel, numsamples, m_channels-1);
return avierr == avi_file::error::NONE;
}