diff options
author | 2016-07-07 19:08:44 +1000 | |
---|---|---|
committer | 2016-07-07 19:10:17 +1000 | |
commit | 717e90b357552bcc720f6df490b62c9f877f2e73 (patch) | |
tree | bdd3786c69815a00271c03244e90aaa58d9bb6a8 /src/osd/modules/render/aviwrite.cpp | |
parent | b77af4ceb61e1d2215a51fe99d4137b8b1d2935d (diff) |
Restore ability to supply explicit name for bgfx AVI output file, auto causes it to generate ascending snap names
Diffstat (limited to 'src/osd/modules/render/aviwrite.cpp')
-rw-r--r-- | src/osd/modules/render/aviwrite.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
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 |