From 717e90b357552bcc720f6df490b62c9f877f2e73 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 7 Jul 2016 19:08:44 +1000 Subject: Restore ability to supply explicit name for bgfx AVI output file, auto causes it to generate ascending snap names --- src/osd/modules/render/aviwrite.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/osd/modules/render/aviwrite.cpp') diff --git a/src/osd/modules/render/aviwrite.cpp b/src/osd/modules/render/aviwrite.cpp index 38bc55f1c0c..64594ff4c91 100644 --- a/src/osd/modules/render/aviwrite.cpp +++ b/src/osd/modules/render/aviwrite.cpp @@ -27,14 +27,14 @@ avi_write::~avi_write() } } -void avi_write::record() +void avi_write::record(const char *name) { if (m_recording) { end_avi_recording(); } - begin_avi_recording(); + begin_avi_recording(name); } void avi_write::stop() @@ -43,7 +43,7 @@ void avi_write::stop() end_avi_recording(); } -void avi_write::begin_avi_recording() +void avi_write::begin_avi_recording(const char *name) { // stop any existing recording end_avi_recording(); @@ -75,13 +75,14 @@ void avi_write::begin_avi_recording() // 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"); + const osd_file::error filerr = (!name || !std::strcmp(name, OSDOPTVAL_AUTO)) + ? m_machine.video().open_next(tempfile, "avi") + : tempfile.open(name); // 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(); + const std::string fullpath = tempfile.fullpath(); tempfile.close(); // create the file and free the string -- cgit v1.2.3-70-g09d2