diff options
-rw-r--r-- | src/osd/modules/render/aviwrite.cpp | 6 | ||||
-rw-r--r-- | src/osd/modules/render/aviwrite.h | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/osd/modules/render/aviwrite.cpp b/src/osd/modules/render/aviwrite.cpp index 9148244111b..e86d8f99ba6 100644 --- a/src/osd/modules/render/aviwrite.cpp +++ b/src/osd/modules/render/aviwrite.cpp @@ -32,7 +32,7 @@ avi_write::~avi_write() } } -void avi_write::record(const char *name) +void avi_write::record(std::string_view name) { if (m_recording) { @@ -48,7 +48,7 @@ void avi_write::stop() end_avi_recording(); } -void avi_write::begin_avi_recording(const char *name) +void avi_write::begin_avi_recording(std::string_view name) { // stop any existing recording end_avi_recording(); @@ -81,7 +81,7 @@ void avi_write::begin_avi_recording(const char *name) // create a new temporary movie file emu_file tempfile(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); - const std::error_condition filerr = (!name || !name[0] || !std::strcmp(name, OSDOPTVAL_AUTO)) + const std::error_condition filerr = (name.empty() || name == OSDOPTVAL_AUTO) ? m_machine.video().open_next(tempfile, "avi") : tempfile.open(name); diff --git a/src/osd/modules/render/aviwrite.h b/src/osd/modules/render/aviwrite.h index e59ce275168..015dcab4acf 100644 --- a/src/osd/modules/render/aviwrite.h +++ b/src/osd/modules/render/aviwrite.h @@ -13,6 +13,8 @@ #include "aviio.h" +#include <string_view> + class running_machine; class avi_write @@ -21,7 +23,7 @@ public: avi_write(running_machine& machine, uint32_t width, uint32_t height); ~avi_write(); - void record(const char *name); + void record(std::string_view name); void stop(); void audio_frame(const int16_t *buffer, int samples_this_frame); void video_frame(bitmap_rgb32& snap); @@ -30,7 +32,7 @@ public: bool recording() const { return m_recording; } private: - void begin_avi_recording(const char *name); + void begin_avi_recording(std::string_view name); void end_avi_recording(); running_machine& m_machine; |