Fix to allow the flac command to parse piped WAV input with
authornu774 <honeycomb77@gmail.com>
Thu, 27 Dec 2012 12:44:38 +0000 (21:44 +0900)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Fri, 28 Dec 2012 00:31:35 +0000 (11:31 +1100)
commit0da96d3cfd13931439324785ca1b89bb788a4a49
tree0c69b9b7f1050babcafdf1e43aff683f13db9b4c
parent55788ea96b6f71300bccfee2e6a8645e83be9768
Fix to allow the flac command to parse piped WAV input with
WAVEFORMATEXTENSIBLE format.

MinGW's fseeko() doesn't return error for the attempt to seek on non
seekable file (same behavior as MSVC).
The simplest solution would be to change #ifdef _MSC_VER to #ifdef
_WIN32 here.
Instead, this patch tests file with fstat(), and use fseeko() only when
it is a regular file.
This is confirmed to work properly both on MSVC and MinGW, can seek if
stdin is a redirected regular file, and doesn't require #ifdef.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
src/flac/encode.c