Commit a0f8e6ad authored by Michael Niedermayer's avatar Michael Niedermayer

tests/tiny_ssim: drop isatty() support

tiny_ssim is build on the host, not the target and the HAVE_* are set for the
target.
This patch fixes building tiny_ssim when HAVE_* differed between target and host
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6e638677
...@@ -32,14 +32,6 @@ ...@@ -32,14 +32,6 @@
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#if HAVE_ISATTY
#if HAVE_IO_H
#include <io.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#endif
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) #define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
...@@ -192,7 +184,7 @@ int main(int argc, char* argv[]) ...@@ -192,7 +184,7 @@ int main(int argc, char* argv[])
double ssim[3] = {0,0,0}; double ssim[3] = {0,0,0};
int frame_size, w, h; int frame_size, w, h;
int frames, seek; int frames, seek;
int i, istty = 1; int i;
if( argc<4 || 2 != sscanf(argv[3], "%dx%d", &w, &h) ) if( argc<4 || 2 != sscanf(argv[3], "%dx%d", &w, &h) )
{ {
...@@ -215,9 +207,6 @@ int main(int argc, char* argv[]) ...@@ -215,9 +207,6 @@ int main(int argc, char* argv[])
seek = argc<5 ? 0 : atoi(argv[4]); seek = argc<5 ? 0 : atoi(argv[4]);
fseek(f[seek<0], seek < 0 ? -seek : seek, SEEK_SET); fseek(f[seek<0], seek < 0 ? -seek : seek, SEEK_SET);
#if HAVE_ISATTY
istty = isatty(0) && isatty(2);
#endif
for( frames=0;; frames++ ) for( frames=0;; frames++ )
{ {
uint64_t ssd_one[3]; uint64_t ssd_one[3];
...@@ -236,11 +225,8 @@ int main(int argc, char* argv[]) ...@@ -236,11 +225,8 @@ int main(int argc, char* argv[])
printf("Frame %d | ", frames); printf("Frame %d | ", frames);
print_results(ssd_one, ssim_one, 1, w, h); print_results(ssd_one, ssim_one, 1, w, h);
if (istty) {
printf(" \r"); printf(" \r");
fflush(stdout); fflush(stdout);
} else
printf("\n");
} }
if( !frames ) return 0; if( !frames ) return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment