Quantcast
Channel: naudio Work Item Rss Feed
Viewing all articles
Browse latest Browse all 738

Commented Unassigned: WaveFormatConversionStream disposes sourceStream [16454]

$
0
0
I think this is a mistake.
Disposing the sourceStream is not the responsibility of the WaveFormatConversionStream class.
I see no point in disposing a resource which was not created by the class itself.

For example: converting a stream to different formats or demultiplexing it succeeds first, then throwing NullReferenceException because sourceStream was disposed in the meantime.
Comments: You are right. I designed this class many years ago and would probably make a different decision today. It's convenient in some circumstances and a pain in others. The workaround I use when I need one is to decorate the input what I call an "IgnoreDisposeStream" which simply ignores calls to dispose but passes all other stream methods through to the source. I will consider this change for a future NAudio though

Viewing all articles
Browse latest Browse all 738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>