File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
audiostream/src/ni/media/audio/os/win Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ template <class Source>
65
65
class SyncronousByteStream : public IMFByteStream
66
66
{
67
67
68
+ static constexpr auto endOfSequence = -1 ;
69
+
68
70
auto tell () -> std::streamsize
69
71
{
70
72
auto pos = m_source.seek ( boost::iostreams::stream_offset ( 0 ), BOOST_IOS::cur );
@@ -86,7 +88,8 @@ class SyncronousByteStream : public IMFByteStream
86
88
87
89
try
88
90
{
89
- *read = static_cast <ULONG>( m_source.read ( reinterpret_cast <char *>( buffer ), toRead ) );
91
+ const auto result = m_source.read ( reinterpret_cast <char *>( buffer ), toRead );
92
+ *read = static_cast <ULONG>( result == endOfSequence ? 0 : result );
90
93
return S_OK;
91
94
}
92
95
catch ( const std::system_error& )
You can’t perform that action at this time.
0 commit comments