forked from mia/Aegisub
bestsource: Expose some options
This commit is contained in:
parent
e41647c78c
commit
70fd08aabe
4 changed files with 20 additions and 1 deletions
|
@ -353,6 +353,11 @@
|
|||
"FFmpegSource" : {
|
||||
"Decoding Threads" : -1,
|
||||
"Unsafe Seeking" : false
|
||||
},
|
||||
"BestSource" : {
|
||||
"Max Cache Size" : 1024,
|
||||
"Threads" : 0,
|
||||
"Seek Preroll" : 12
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -353,6 +353,11 @@
|
|||
"FFmpegSource" : {
|
||||
"Decoding Threads" : -1,
|
||||
"Unsafe Seeking" : false
|
||||
},
|
||||
"BestSource" : {
|
||||
"Max Cache Size" : 1024,
|
||||
"Threads" : 0,
|
||||
"Seek Preroll" : 12
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue