]> git.sesse.net Git - nageru/blobdiff - futatabi/frame_on_disk.cpp
Make Futatabi accept and record the audio, although it cannot use it for anything...
[nageru] / futatabi / frame_on_disk.cpp
index c3e3b4db496e4902e7239f61b2d53c98b57e7825..9a870947b4b84c171de2897ae5ad9523a88f6e52 100644 (file)
@@ -66,7 +66,7 @@ string FrameReader::read_frame(FrameOnDisk frame)
                fd = open(filename.c_str(), O_RDONLY);
                if (fd == -1) {
                        perror(filename.c_str());
-                       exit(1);
+                       abort();
                }
 
                // We want readahead. (Ignore errors.)
@@ -76,14 +76,17 @@ string FrameReader::read_frame(FrameOnDisk frame)
                ++metric_frame_opened_files;
        }
 
+       // TODO: Read the audio.
+
        string str;
        str.resize(frame.size);
        off_t offset = 0;
        while (offset < frame.size) {
                int ret = pread(fd, &str[offset], frame.size - offset, frame.offset + offset);
                if (ret <= 0) {
+                       string filename = frame_filenames[frame.filename_idx];
                        perror("pread");
-                       exit(1);
+                       abort();
                }
 
                offset += ret;