streaming detection based on SEEK_END, tested and working in MediaPlayer for ogg streams from SoundPlay live encoder (oggenc)

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6614 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
shatty 2004-02-17 09:56:53 +00:00
parent cd58ac9968
commit 56b91b1a41
1 changed files with 9 additions and 0 deletions

View File

@ -184,6 +184,15 @@ get_seekable(BDataIO * data)
// really screwed
return 0;
}
// next try to seek to the end of the stream (absolutely)
if (seekable->Seek(0, SEEK_END) < 0) {
return 0;
}
// then seek back to where we started
if (seekable->Seek(current, SEEK_SET) < 0) {
// really screwed
return 0;
}
return seekable;
}