[Flac-dev] flac reports error unnecessarily

Kevin Kleinfelter flac-dev at kleinfelter.com
Wed Jun 25 07:38:37 PDT 2003

I'm embedding flac in a Samba VFS application.  flac gets called to 
decompress files, which Samba serves up to the client as WAV files.  Every 
time a Windows client browses a folder, it opens music files to read the 
header, and then it closes them without reading the entire file.  I'm 
accessing flac via popen/pclose.

Each time I close the pipe to flac 'prematurely' (i.e. before flac has 
decoded the entire file) it issues "ERROR while decoding data" because 
FLAC__file_decoder_process_until_end_of_file returns an error indication.

As a quick hack, I added a check for errno == EPIPE in decode.c.  This 
solves *my* immediate problem.

I propose that, when output is to stdout, 
FLAC__file_decoder_process_until_end_of_file should not return an error 
indication on a broken output pipe, because pipes get broken all the time.

More information about the Flac-dev mailing list