#include <string.h>
#include <locale.h>
#include <errno.h>
+#include <sys/stat.h>
#include <getopt.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef _WIN32
+#include <io.h>
+#endif
#include "compat.h"
#include "wav_reader.h"
#include "aacenc.h"
if (params->bitrate_mode)
sprintf(p, "VBR mode %d", params->bitrate_mode);
else
- sprintf(p, "CBR %dkbps", params->bitrate / 1000);
+ sprintf(p, "CBR %dkbps",
+ aacEncoder_GetParam(encoder, AACENC_BITRATE) / 1000);
m4af_add_itmf_string_tag(m4af, M4AF_TAG_TOOL, tool_info);
}
const pcm_sample_description_t *sample_format;
int downsampled_timescale = 0;
int frame_count = 0;
+ struct stat stb = { 0 };
setlocale(LC_CTYPE, "");
setbuf(stderr, 0);
goto END;
}
- if (ifp == stdin)
+ if (fstat(fileno(ifp), &stb) == 0 && (stb.st_mode & S_IFMT) != S_IFREG)
wav_io.seek = 0;
if ((wavf = wav_open(&wav_io, ifp, params.ignore_length)) == 0) {