From: kramm Date: Mon, 20 Sep 2004 16:09:15 +0000 (+0000) Subject: added vfw videoreader. X-Git-Tag: release-0-6-2~64 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=95c9749e83bf6b3222f5d1a7b880c6c32bd0914a;p=swftools.git added vfw videoreader. --- diff --git a/avi2swf/avi2swf.cc b/avi2swf/avi2swf.cc index dc9f5fe..82d70c6 100644 --- a/avi2swf/avi2swf.cc +++ b/avi2swf/avi2swf.cc @@ -28,7 +28,11 @@ #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"; @@ -226,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); @@ -236,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); } @@ -265,7 +273,7 @@ int main (int argc,char ** argv) 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); @@ -284,7 +292,7 @@ int main (int argc,char ** argv) void*buf = malloc(video.width*video.height*4); for(t=0;t