shithub: sox

Download patch

ref: 0141f233364b96bee00bee7463c494a981f50e55
parent: e04b05e7185f6b08f43f44c6d3b884a46c65a941
author: robs <robs>
date: Sun Mar 16 13:59:01 EDT 2008

don't display null file-name

--- a/src/sox.c
+++ b/src/sox.c
@@ -195,10 +195,13 @@
   sox_size_t ws = ft->length / ft->signal.channels;
   (void)full;
 
-  fprintf(output, "\n%s:", ft->filename);
-  if (strcmp(ft->filename, "-") == 0 || (ft->handler.flags & SOX_FILE_DEVICE))
-    fprintf(output, " (%s)", ft->handler.names[0]);
-  fprintf(output, "\n\n");
+  fprintf(output, "\n");
+  if (ft->filename[0]) {
+    fprintf(output, "%s:", ft->filename);
+    if (strcmp(ft->filename, "-") == 0 || (ft->handler.flags & SOX_FILE_DEVICE))
+      fprintf(output, " (%s)", ft->handler.names[0]);
+    fprintf(output, "\n\n");
+  }
 
   fprintf(output, "  Encoding: %-14s", sox_encodings_short_str[ft->encoding.encoding]);
   text = find_comment(f->ft->comments, "Comment");