File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -436,7 +436,7 @@ MediaEventManager EventManager
436
436
437
437
/// <summary>Get duration (in ms) of media descriptor object item.</summary>
438
438
/// <returns>duration of media item or -1 on error</returns>
439
- public long Duration => Native . LibVLCMediaGetDuration ( NativeReference ) ;
439
+ public long Duration => NativeReference == IntPtr . Zero ? - 1 : Native . LibVLCMediaGetDuration ( NativeReference ) ;
440
440
441
441
/// <summary>
442
442
/// Parse the media asynchronously with options.
@@ -486,7 +486,7 @@ void OnParsedChanged(object sender, MediaParsedChangedEventArgs mediaParsedChang
486
486
487
487
/// <summary>Return true is the media descriptor object is parsed</summary>
488
488
/// <returns>true if media object has been parsed otherwise it returns false</returns>
489
- public bool IsParsed => Native . LibVLCMediaIsParsed ( NativeReference ) != 0 ;
489
+ public bool IsParsed => NativeReference == IntPtr . Zero ? false : Native . LibVLCMediaIsParsed ( NativeReference ) != 0 ;
490
490
491
491
/// <summary>Get Parsed status for media descriptor object.</summary>
492
492
/// <returns>a value of the libvlc_media_parsed_status_t enum</returns>
You can’t perform that action at this time.
0 commit comments