bestsource: Expose some options

This commit is contained in:
arch1t3cht 2022-08-10 02:40:02 +02:00
parent e41647c78c
commit 70fd08aabe
4 changed files with 20 additions and 1 deletions

View file

@ -353,6 +353,11 @@
"FFmpegSource" : {
"Decoding Threads" : -1,
"Unsafe Seeking" : false
},
"BestSource" : {
"Max Cache Size" : 1024,
"Threads" : 0,
"Seek Preroll" : 12
}
}
},

View file

@ -353,6 +353,11 @@
"FFmpegSource" : {
"Decoding Threads" : -1,
"Unsafe Seeking" : false
},
"BestSource" : {
"Max Cache Size" : 1024,
"Threads" : 0,
"Seek Preroll" : 12
}
}
},

View file

@ -452,6 +452,13 @@ void Advanced_Video(wxTreebook *book, Preferences *parent) {
p->OptionAdd(ffms, _("Enable unsafe seeking"), "Provider/Video/FFmpegSource/Unsafe Seeking");
#endif
#ifdef WITH_BESTSOURCE
auto bs = p->PageSizer("BestSource");
p->OptionAdd(bs, _("Max cache size (MB)"), "Provider/Video/BestSource/Max Cache Size");
p->OptionAdd(bs, _("Decoder Threads (0 to autodetect)"), "Provider/Video/BestSource/Threads");
p->OptionAdd(bs, _("Seek preroll (Frames)"), "Provider/Video/BestSource/Seek Preroll");
#endif
p->SetSizerAndFit(p->sizer);
}

View file

@ -108,8 +108,10 @@ std::string colormatrix_description(const AVFrame *frame) {
BSVideoProvider::BSVideoProvider(agi::fs::path const& filename, std::string const& colormatrix, agi::BackgroundRunner *br) try
: bsopts()
, bs(filename.string(), "", -1, false, 0, GetCacheFile(filename), &bsopts)
, bs(filename.string(), "", -1, false, OPT_GET("Provider/Video/BestSource/Threads")->GetInt(), GetCacheFile(filename), &bsopts)
{
bs.SetMaxCacheSize(OPT_GET("Provider/Video/BestSource/Max Cache Size")->GetInt() << 20);
bs.SetSeekPreRoll(OPT_GET("Provider/Video/BestSource/Seek Preroll")->GetInt());
try {
BestAudioSource dummysource(filename.string(), -1, 0, "");
has_audio = true;