Mf Reader :: Filename with Accent

Dec 9, 2012 at 10:52 AM

In MediafoundationReader.cs (CreateReader....)

//var uri = new Uri(file);
	
	
// Obsolete 
// var uri = new Uri(file,true)


Uri nUrl = null;
string str = "";
if (Uri.TryCreate(file, UriKind.Absolute, out nUrl))
{
	str = nUrl.ToString();
}
else
{
	str = nUrl.AbsoluteUri;
}

			
MediaFoundationInterop.MFCreateSourceReaderFromURL(str, null, out reader);

Coordinator
Dec 11, 2012 at 1:05 PM

I'm thinking that MediaFoundationReader should simply pass the file value straight through. This seems to work fine in my tests. This would allow it to be a URL or an absolute path and fixes the problem with accents in the filename.

Mark

Dec 11, 2012 at 2:58 PM

Oh yeah, as usual your version is more simple.