If error is ENOSPACE just give up. ffmpeg crashes if we try again.

This commit is contained in:
Isaac Connor 2022-01-10 19:56:00 -05:00
parent 947132284d
commit 81fc392bc2
1 changed files with 8 additions and 2 deletions

View File

@ -497,8 +497,14 @@ bool VideoStore::open() {
Debug(1, "using movflags %s", movflags_entry->value);
}
if ((ret = avformat_write_header(oc, &opts)) < 0) {
Warning("Unable to set movflags trying with defaults.");
// we crash if we try again
if (ENOSPC != ret) {
Warning("Unable to set movflags trying with defaults.%d %s",
ret, av_make_error_string(ret).c_str());
ret = avformat_write_header(oc, nullptr);
Debug(1, "Done %d", ret);
}
} else if (av_dict_count(opts) != 0) {
Info("some options not used, turn on debugging for a list.");
AVDictionaryEntry *e = nullptr;