projects
/
fdkaac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
112fdaf
)
use fstat() to test seekability of input file
author
nu774
<honeycomb77@gmail.com>
Sun, 6 Jan 2013 04:41:31 +0000
(13:41 +0900)
committer
nu774
<honeycomb77@gmail.com>
Sun, 6 Jan 2013 04:41:31 +0000
(13:41 +0900)
src/main.c
patch
|
blob
|
blame
|
history
diff --git
a/src/main.c
b/src/main.c
index 41ea73181187c2c68116d886683b468916a581e1..e12e8fb170bd4e371d9e56f7ddffcb56c1eb9233 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-13,7
+13,14
@@
#include <string.h>
#include <locale.h>
#include <errno.h>
#include <string.h>
#include <locale.h>
#include <errno.h>
+#include <sys/stat.h>
#include <getopt.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"
#include "compat.h"
#include "wav_reader.h"
#include "aacenc.h"
@@
-470,6
+477,7
@@
int main(int argc, char **argv)
const pcm_sample_description_t *sample_format;
int downsampled_timescale = 0;
int frame_count = 0;
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);
setlocale(LC_CTYPE, "");
setbuf(stderr, 0);
@@
-483,7
+491,7
@@
int main(int argc, char **argv)
goto END;
}
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) {
wav_io.seek = 0;
if ((wavf = wav_open(&wav_io, ifp, params.ignore_length)) == 0) {
This page took
0.011982 seconds
and
4
git commands to generate.