diff options
author | 2020-01-07 11:59:06 +0100 | |
---|---|---|
committer | 2020-01-07 11:59:06 +0100 | |
commit | 1f34f94e53126a40e2dc8d473cf1cf7a75ec5f6e (patch) | |
tree | 134fdd5a50ff1f89c694487d96f7088e8150c72b | |
parent | aad19c92f57bf7b9c639441d3a51f237583dc652 (diff) |
fixed -aviwrite/-mngwrite crash with screenless systems [Oliver Stöne… (#6139)
* fixed -aviwrite/-mngwrite crash with screenless systems [Oliver Stöneberg, hap]
* can record video with noscreens (nw)
* need to use default frame rate for screen-less MNG recording as well (nw)
Co-authored-by: hap <happppp@users.noreply.github.com>
-rw-r--r-- | src/emu/video.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/emu/video.cpp b/src/emu/video.cpp index fa0efb88a89..71bc97d6cef 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -451,7 +451,7 @@ void video_manager::begin_recording_mng(const char *name, uint32_t index, screen if (filerr == osd_file::error::NONE) { // start the capture - int rate = int(screen->frame_period().as_hz()); + int rate = int(screen ? screen->frame_period().as_hz() : screen_device::DEFAULT_FRAME_RATE); png_error pngerr = mng_capture_start(*info.m_mng_file, m_snap_bitmap, rate); if (pngerr != PNGERR_NONE) { @@ -487,7 +487,7 @@ void video_manager::begin_recording_avi(const char *name, uint32_t index, screen // build up information about this new movie avi_file::movie_info info; info.video_format = 0; - info.video_timescale = 1000 * screen->frame_period().as_hz(); + info.video_timescale = 1000 * (screen ? screen->frame_period().as_hz() : screen_device::DEFAULT_FRAME_RATE); info.video_sampletime = 1000; info.video_numsamples = 0; info.video_width = m_snap_bitmap.width(); @@ -554,7 +554,14 @@ void video_manager::begin_recording(const char *name, movie_format format) // create a snapshot bitmap so we know what the target size is screen_device_iterator iterator = screen_device_iterator(machine().root_device()); screen_device_iterator::auto_iterator iter = iterator.begin(); - const uint32_t count = (uint32_t)iterator.count(); + uint32_t count = (uint32_t)iterator.count(); + const bool no_screens(!count); + + if (no_screens) + { + assert(!m_snap_native); + count = 1; + } switch (format) { |