From 0be89102741d33c75cfd90ce92ec344c1bcdd726 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 13 Mar 2015 07:45:52 +0100 Subject: Add kludge for pipe input --- audio_read.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/audio_read.c b/audio_read.c index aa97def..007f020 100644 --- a/audio_read.c +++ b/audio_read.c @@ -470,6 +470,13 @@ parse_input_file (FILE * musicin, char inPath[MAX_NAME_SIZE], frame_header *head return; } + if (fseek (musicin, 0L, SEEK_SET) == -1) { + fprintf (stderr, "Input is not seekable, assuming pipe with raw PCM\n"); + fprintf (stderr, "Remember to set samplerate with '-s'.\n"); + *num_samples = MAX_U_32_NUM; /* huge sound file */ + return; + } + /**************************** AIFF ********************************/ if ((soundPosition = aiff_read_headers (musicin, &pcm_aiff_data)) != -1) { fprintf (stderr, ">>> Using Audio IFF sound file headers\n"); -- cgit v1.2.3