formats.c registers usage of stdin and stdout by sox_globals.stdin/out_in_use_by but doesn't reset that global when lsx_close is called.
That makes it impossible to run up another input or output using stdin or stdout in the same process, even atfer the first one has finished.
The attached patch fixes it, the attached python demonstrates it using pysox - without the patch it blocks, with the patch it can process multiple input files one after the other.
without the patch it
blockserrors out with "(stdin) already in use by `audio input'"Sample wav of silence attached.