]> git.sesse.net Git - nageru/commitdiff
Ask for no buffering when opening FFmpeg streams; we do our own buffering, and the...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 11 Apr 2018 18:06:38 +0000 (20:06 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 11 Apr 2018 19:05:10 +0000 (21:05 +0200)
ffmpeg_capture.cpp

index e7f25e3750a88237a66bda46c7425e7a953db2fd..bbbb941065f90e4a896f65237836b34ffcd4738f 100644 (file)
@@ -349,7 +349,10 @@ bool FFmpegCapture::play_video(const string &pathname)
                last_modified = buf.st_mtim;
        }
 
-       auto format_ctx = avformat_open_input_unique(pathname.c_str(), nullptr, nullptr);
+       AVDictionary *opts = nullptr;
+       av_dict_set(&opts, "fflags", "nobuffer", 0);
+
+       auto format_ctx = avformat_open_input_unique(pathname.c_str(), nullptr, &opts);
        if (format_ctx == nullptr) {
                fprintf(stderr, "%s: Error opening file\n", pathname.c_str());
                return false;