diff options
Diffstat (limited to 'src/osd/modules/render/aviwrite.cpp')
-rw-r--r-- | src/osd/modules/render/aviwrite.cpp | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/osd/modules/render/aviwrite.cpp b/src/osd/modules/render/aviwrite.cpp index 9ff7c5ab17d..38bc55f1c0c 100644 --- a/src/osd/modules/render/aviwrite.cpp +++ b/src/osd/modules/render/aviwrite.cpp @@ -27,17 +27,14 @@ avi_write::~avi_write() } } -void avi_write::record(std::string name) +void avi_write::record() { if (m_recording) { end_avi_recording(); } - if (name != "") - { - begin_avi_recording(name); - } + begin_avi_recording(); } void avi_write::stop() @@ -46,7 +43,7 @@ void avi_write::stop() end_avi_recording(); } -void avi_write::begin_avi_recording(std::string name) +void avi_write::begin_avi_recording() { // stop any existing recording end_avi_recording(); @@ -73,25 +70,20 @@ void avi_write::begin_avi_recording(std::string name) info.audio_samplebits = 16; info.audio_samplerate = m_machine.sample_rate(); - // create a new temporary movie file - osd_file::error filerr; - std::string fullpath; - { - emu_file tempfile(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - filerr = tempfile.open(name.c_str()); - - // compute the frame time - m_frame_period = attotime::from_seconds(1000) / info.video_timescale; + // compute the frame time + m_frame_period = attotime::from_seconds(1000) / info.video_timescale; - // if we succeeded, make a copy of the name and create the real file over top - if (filerr == osd_file::error::NONE) - { - fullpath = tempfile.fullpath(); - } - } + // create a new temporary movie file + emu_file tempfile(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); + + osd_file::error filerr = m_machine.video().open_next(tempfile, "avi"); + // if we succeeded, make a copy of the name and create the real file over top if (filerr == osd_file::error::NONE) { + std::string fullpath = tempfile.fullpath(); + tempfile.close(); + // create the file and free the string avi_file::error avierr = avi_file::create(fullpath, info, m_output_file); if (avierr != avi_file::error::NONE) |