]> git.sesse.net Git - nageru/blobdiff - futatabi/main.cpp
In Futatabi, ignore non-video streams for now.
[nageru] / futatabi / main.cpp
index 7c5f660ae5b97f928aed6b9c8daabe18a5744cc4..4c54d332d24951b9118798b86c90ef3ab10e464b 100644 (file)
@@ -79,7 +79,7 @@ FrameOnDisk write_frame(int stream_idx, int64_t pts, const uint8_t *data, size_t
 {
        if (open_frame_files.count(stream_idx) == 0) {
                char filename[256];
-               snprintf(filename, sizeof(filename), "%s/frames/cam%d-pts%09ld.frames",
+               snprintf(filename, sizeof(filename), "%s/frames/cam%d-pts%09" PRId64 ".frames",
                         global_flags.working_directory.c_str(), stream_idx, pts);
                FILE *fp = fopen(filename, "wb");
                if (fp == nullptr) {
@@ -275,7 +275,6 @@ int main(int argc, char **argv)
 
        should_quit = true;
        record_thread.join();
-       JPEGFrameView::shutdown();
 
        return ret;
 }
@@ -503,7 +502,8 @@ void record_thread_func()
                        if (av_read_frame(format_ctx.get(), &pkt) != 0) {
                                break;
                        }
-                       if (pkt.stream_index >= MAX_STREAMS) {
+                       if (pkt.stream_index >= MAX_STREAMS ||
+                           format_ctx->streams[pkt.stream_index]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) {
                                continue;
                        }