]> git.sesse.net Git - bmusb/blobdiff - bmusb.cpp
Release 0.7.8.
[bmusb] / bmusb.cpp
index abab109dc8ceb4e7fe77c07493017a898d53a8ee..19a9da1aa2c52ca1ed22c980b3c244db405970e6 100644 (file)
--- a/bmusb.cpp
+++ b/bmusb.cpp
@@ -1,4 +1,4 @@
-// Intensity Shuttle USB3 capture driver, v0.7.2
+// Intensity Shuttle USB3 capture driver, v0.7.8
 // Can download 8-bit and 10-bit UYVY/v210-ish frames from HDMI, quite stable
 // (can do captures for hours at a time with no drops), except during startup
 // 576p60/720p60/1080i60 works, 1080p60 does not work (firmware limitation)
@@ -342,7 +342,9 @@ void dump_frame(const char *filename, uint8_t *frame_start, size_t frame_len)
 
 void dump_audio_block(uint8_t *audio_start, size_t audio_len)
 {
-       fwrite(audio_start + AUDIO_HEADER_SIZE, 1, audio_len - AUDIO_HEADER_SIZE, audiofp);
+       if (audiofp != nullptr) {
+               fwrite(audio_start + AUDIO_HEADER_SIZE, 1, audio_len - AUDIO_HEADER_SIZE, audiofp);
+       }
 }
 
 void BMUSBCapture::dequeue_thread_func()