format: improve is_seekable() test
commitbb38934e11035c8fab141f70dabda3afdd17da36
authorMans Rullgard <mans@mansr.com>
Tue, 4 Aug 2020 16:19:49 +0000 (4 17:19 +0100)
committerMans Rullgard <mans@mansr.com>
Tue, 4 Aug 2020 16:20:11 +0000 (4 17:20 +0100)
treeea034749b5dc4ca872546191c1b74cb5616efa09
parentc972f90f8d7f2e4ff8d2c865ef7b2f897a408de7
format: improve is_seekable() test

Streams opened with fmemopen() do not have an underlying file descriptor,
so the fstat() will fail, and a random result is returned.

A simpler method that works regardless of file type is to call fseek()
and check if it reports success.

Suggested by Stefan Sauer <ensonic@google.com>.
src/formats.c