File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,27 @@ public abstract class FFBase : IDisposable
14
14
protected string ConfiguredRoot ;
15
15
protected Process Process ;
16
16
17
- protected FFBase ( )
17
+ protected FFBase ( FFMpegOptions opts = null )
18
18
{
19
- ConfiguredRoot =
20
- ! File . Exists ( _ConfigFile ) ?
21
- _DefaultRoot :
22
- JsonConvert . DeserializeObject < Dictionary < string , string > > ( File . ReadAllText ( _ConfigFile ) ) [ "RootDirectory" ] ;
19
+ var options = opts ;
20
+
21
+ if (
22
+ opts == null &&
23
+ File . Exists ( _ConfigFile )
24
+ )
25
+ {
26
+ options = JsonConvert . DeserializeObject < FFMpegOptions > ( File . ReadAllText ( _ConfigFile ) ) ;
27
+ }
28
+
29
+ if ( options == null )
30
+ {
31
+ options = new FFMpegOptions
32
+ {
33
+ RootDirectory = _DefaultRoot
34
+ } ;
35
+ }
36
+
37
+ ConfiguredRoot = options . RootDirectory ;
23
38
}
24
39
25
40
/// <summary>
Original file line number Diff line number Diff line change
1
+ namespace FFMpegCore . FFMPEG
2
+ {
3
+ public class FFMpegOptions
4
+ {
5
+ public string RootDirectory { get ; set ; }
6
+ }
7
+ }
You can’t perform that action at this time.
0 commit comments