X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=avi2swf%2Favi2swf.cc;h=82d70c660ff8311cf0e5cb0e11a33f65c2131fd6;hb=95c9749e83bf6b3222f5d1a7b880c6c32bd0914a;hp=c530cbbb3ca29cb32d3b9706f31d7dc556938ede;hpb=1c4649900f64f30c7e7071808df4a7910751b20d;p=swftools.git diff --git a/avi2swf/avi2swf.cc b/avi2swf/avi2swf.cc index c530cbb..82d70c6 100644 --- a/avi2swf/avi2swf.cc +++ b/avi2swf/avi2swf.cc @@ -26,19 +26,13 @@ #include "../config.h" -#ifdef HAVE_SIGNAL_H -#ifdef HAVE_PTHREAD_H -#include -#include -#define DO_SIGNALS -#endif -#endif - -extern "C" { #include "../lib/args.h" -} #include "v2swf.h" +#ifdef WIN32 +#include "videoreader_vfw.hh" +#else #include "videoreader_avifile.hh" +#endif static char * filename = 0; static char * outputfilename = "output.swf"; @@ -188,9 +182,6 @@ static char*itoa(int a) return toabuf; } -static int shutdown_avi2swf = 0; -static int frameno = 0; - #ifdef DO_SIGNALS pthread_t main_thread; static void sigterm(int sig) @@ -239,7 +230,11 @@ int main (int argc,char ** argv) exit(1); } +#ifdef WIN32 + ret = videoreader_vfw_open(&video, filename); +#else ret = videoreader_avifile_open(&video, filename); +#endif if(!ret) { printf("Error opening %s\n", filename); @@ -249,7 +244,7 @@ int main (int argc,char ** argv) if(verbose) { printf("| video framerate: %f\n", video.fps); printf("| video size: %dx%d\n", video.width, video.height); - printf("| audio rate: %d\n", video.rate); + printf("| audio rate: %d\n", video.samplerate); printf("| audio channels: %d\n", video.channels); } @@ -269,12 +264,16 @@ int main (int argc,char ** argv) v2swf_setparameter(&v2swf, "keyframe_interval", itoa(keyframe_interval)); if(expensive) v2swf_setparameter(&v2swf, "motioncompensation", "1"); + if(flip) + video.setparameter(&video, "flip", "1"); + if(verbose) + video.setparameter(&video, "verbose", "1"); if(!verbose) printf("\n"); if(audio_adjust>0) { - int num = ((int)(audio_adjust*video.rate))*video.channels*2; + int num = ((int)(audio_adjust*video.samplerate))*video.channels*2; void*buf = malloc(num); video.getsamples(&video, buf, num); free(buf); @@ -293,9 +292,9 @@ int main (int argc,char ** argv) void*buf = malloc(video.width*video.height*4); for(t=0;t