diff --git a/pkg/media/oggreader/oggreader.go b/pkg/media/oggreader/oggreader.go index 50d1a7cd87b..5aaeb8b94eb 100644 --- a/pkg/media/oggreader/oggreader.go +++ b/pkg/media/oggreader/oggreader.go @@ -189,6 +189,8 @@ func (o *OggReader) ParseNextPage() ([]byte, *OggPageHeader, error) { } } + o.bytesReadSuccesfully += int64(len(h) + len(sizeBuffer) + len(payload)) + return payload, pageHeader, nil } diff --git a/pkg/media/oggreader/oggreader_test.go b/pkg/media/oggreader/oggreader_test.go index 787f5573b4e..cbb151e9e5f 100644 --- a/pkg/media/oggreader/oggreader_test.go +++ b/pkg/media/oggreader/oggreader_test.go @@ -46,10 +46,12 @@ func TestOggReader_ParseNextPage(t *testing.T) { reader, _, err := NewWith(ogg) assert.NoError(t, err) assert.NotNil(t, reader) + assert.Equal(t, int64(47), reader.bytesReadSuccesfully) payload, _, err := reader.ParseNextPage() assert.Equal(t, []byte{0x98, 0x36, 0xbe, 0x88, 0x9e}, payload) assert.NoError(t, err) + assert.Equal(t, int64(80), reader.bytesReadSuccesfully) _, _, err = reader.ParseNextPage() assert.Equal(t, err, io.EOF)