Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Memory Mapped Exception on MediaPlayer.Play(Uri) #529

Closed
1 task done
jsymon opened this issue Mar 4, 2019 · 8 comments
Closed
1 task done

Memory Mapped Exception on MediaPlayer.Play(Uri) #529

jsymon opened this issue Mar 4, 2019 · 8 comments

Comments

@jsymon
Copy link

jsymon commented Mar 4, 2019

I have an issue about Vlc.DotNet.

Generic information

  • Vlc.DotNet version : (3.0.0-develop343)
  • Vlc.DotNet project used : (WPF)
  • libvlc version : (x64) - Referencing VLC libvlc 3.0.6
  • .net version : (4.6.2)
  • Project language : (C#)
  • Project build architecture : (AnyCPU / x64)
  • Operating system : (Windows 10) (x64)

Summary

Upgraded to 343 from 322.

Calling SourceProvider.MediaPlayer.Play(FileInfo); works fine, however calling SourceProvider.MediaPlayer.Play(uri, new[] { "" });, with a UDP uri provokes the following crash:

[ System.ArgumentOutOfRangeException: A positive number is required.
Parameter name: capacity
   at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateNew(String mapName, Int64 capacity, MemoryMappedFileAccess access, MemoryMappedFileOptions options, MemoryMappedFileSecurity memoryMappedFileSecurity, HandleInheritability inheritability)
   at Vlc.DotNet.Wpf.VlcVideoSourceProvider.VideoFormat(IntPtr& userdata, IntPtr chroma, UInt32& width, UInt32& height, UInt32& pitches, UInt32& lines)](url)

Edit, tried 'develop333' revision, which works completely fine with Uri and FileInfo.

  • I confirm that my issue doesn't happen in VLC itself.
@jeremyVignelles
Copy link
Collaborator

develop322 works fine?
What's your stream?

@jsymon
Copy link
Author

jsymon commented Mar 4, 2019

develop322 works fine?

Yes, and develop333 also.

What's your stream?

It's an internal UDP stream, apologies.

@jsymon
Copy link
Author

jsymon commented Mar 4, 2019

Have attached the following stackdump if interested:

image

@jeremyVignelles
Copy link
Collaborator

Ok, then, this is introduced by PR #526 .

Can you call (VideoTrack)MediaPlayer.GetMedia().Tracks.First(track => track.Type == MediaTrackTypes.Video).TrackInfo and look at Width and Height?

I'd bet they are 0...

@jsymon
Copy link
Author

jsymon commented Mar 4, 2019

Ok, then, this is introduced by PR #526 .

Can you call (VideoTrack)MediaPlayer.GetMedia().Tracks.First(track => track.Type == MediaTrackTypes.Video).TrackInfo and look at Width and Height?

I'd bet they are 0...

Correct, TrackInfo just contains a whole bunch of zero's.

@jeremyVignelles
Copy link
Collaborator

Could you make a PR to fix this? we need to check if(trackInfo.width > 0 && trackInfo.height > 0) before assigning width and height. leave the break outside the if. Test it and publish the PR.

Otherwise, I'll do that in my free time.

@jsymon
Copy link
Author

jsymon commented Mar 4, 2019

Can confirm:

var trackInfo = (VideoTrack)track.TrackInfo;
if (trackInfo.Width == 0 || trackInfo.Height == 0)
    continue;

Fixes it. Will see if I have time to create the PR this week...

@jeremyVignelles
Copy link
Collaborator

I just created #531 , which should fix your issue.
Are you able to download those packages manually and install them in your project to confirm that they work for you?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants