Re: Decode ogg file while downloading: what are the good practices?

Matthieu Regnauld <[email protected]> Mon, 5 Nov 2018 20:46:21 +0100
Newsgroups gmane.comp.multimedia.ogg.vorbis.devel
Message-ID <CADjM6tAd8LBOLAs7eFjo4j1RyL=w+68TDXw46WSYjPo9DatH3Q@mail.gmail.com>
--===============8793437062061190153==
Content-Type: multipart/alternative; boundary="00000000000084e9a40579f022fd"

--00000000000084e9a40579f022fd
Content-Type: text/plain; charset="UTF-8"

Hello,

After more tests, I discovered a new problem in my code (
https://gist.github.com/mregnauld/3f7cdc43b02ec3bbd91641b9333ba072) while
seeking in an audio file that is being downloaded.

When I seek in random positions (when I call OggPlayer::seek()), while I
extract audio samples (when I call OggPlayer::extract() every 5ms, in my
test - basically, I just play the audio file), sometimes, I get random
errors with ov_read():
- sometimes it returns 0 (end of file)
- sometimes it returns an error (like an OV_HOLE error)
- sometimes it just crashes

And that, even if I seek to a position which is at least 44100 frames (1
second) before the end of the file...

Has anyone had this problem? Is there maybe any buffer somewhere that I
forget to flush, or something?

Thanks for your help.

--00000000000084e9a40579f022fd
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr">Hello,<div><br></div><div>After more tests, I discovered a new pr=
oblem in my code (<a href=3D"https://gist.github.com/mregnauld/3f7cdc43b02e=
c3bbd91641b9333ba072">https://gist.github.com/mregnauld/3f7cdc43b02ec3bbd91=
641b9333ba072</a>) while seeking in an audio file that is being downloaded.=
</div><div><br></div><div>When I seek in random positions (when I call <fon=
t face=3D"monospace, monospace">OggPlayer::seek()</font>), while I extract =
audio samples (when I call=C2=A0<font face=3D"monospace, monospace">OggPlay=
er::extract()</font> every 5ms, in my test - basically, I just play the aud=
io file), sometimes, I get random errors with <font face=3D"monospace, mono=
space">ov_read()</font>:</div><div>- sometimes it returns 0 (end of file)</=
div><div>- sometimes it returns an error (like an=C2=A0OV_HOLE error)</div>=
<div>- sometimes it just crashes</div><div><br></div><div>And that, even if=
 I seek to a position which is at least 44100 frames (1 second) before the =
end of the file...</div><div><br></div><div>Has anyone had this problem? Is=
 there maybe any buffer somewhere that I forget to flush, or something?</di=
v><div><br></div><div>Thanks for your help.</div><div><br></div></div></div=
></div></div></div>

--00000000000084e9a40579f022fd--

--===============8793437062061190153==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVm9yYmlzLWRl
diBtYWlsaW5nIGxpc3QKVm9yYmlzLWRldkB4aXBoLm9yZwpodHRwOi8vbGlzdHMueGlwaC5vcmcv
bWFpbG1hbi9saXN0aW5mby92b3JiaXMtZGV2Cg==

--===============8793437062061190153==--