Browse Source

demux/mkv: return 0 when the data was not fully read

This is how the IOCallback abstraction works [^1].
Either you read the amount requested, or you return 0.

vlc_stream_Read() reads the whole amount of data, unless it reaches the end of file.
In that case it returns the amount it could read.

[^1]: ba5707e326/ebml/IOCallback.h (L30)
pull/177/head
Steve Lhomme 1 year ago
parent
commit
6e4a202e9b
  1. 2
      modules/demux/mkv/stream_io_callback.cpp

2
modules/demux/mkv/stream_io_callback.cpp

@ -40,7 +40,7 @@ uint32 vlc_stream_io_callback::read( void *p_buffer, size_t i_size )
return 0;
int i_ret = vlc_stream_Read( s, p_buffer, i_size );
return i_ret < 0 ? 0 : i_ret;
return i_ret < 0 || i_ret < i_size ? 0 : i_ret;
}
void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode )

Loading…
Cancel
Save