X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=avi2swf%2Fv2swf.c;h=2caed7b88ce6f44bcf12b4e43996e19c3072b91a;hp=e983c36a4964994010a05133d277b11b1aa63ff5;hb=d6b5ebb01904d445f6ed9e00a54ca5e1e6c800cd;hpb=fc408e5f0214a25910220fc798412a344ec7c5e1 diff --git a/avi2swf/v2swf.c b/avi2swf/v2swf.c index e983c36..2caed7b 100644 --- a/avi2swf/v2swf.c +++ b/avi2swf/v2swf.c @@ -168,7 +168,7 @@ static void writeShape(v2swf_internal_t*i, int id, int gfxid, int width, int hei static int getSamples(videoreader_t*video, S16*data, int len, double speedup) { double pos = 0; - double ratio = (double) video->rate * speedup / swf_mp3_in_samplerate; + double ratio = (double) video->samplerate * speedup / swf_mp3_in_samplerate; int rlen = (int)(len * ratio); int t; S16 tmp[576*32]; @@ -209,7 +209,7 @@ static void writeAudioForOneFrame(v2swf_internal_t* i) msg("writeAudioForOneFrame()"); - if(i->video->channels<=0 || i->video->rate<=0) + if(i->video->channels<=0 || i->video->samplerate<=0) return; /* no sound in video */ blocksize = (i->samplerate > 22050) ? 1152 : 576; @@ -229,7 +229,7 @@ static void writeAudioForOneFrame(v2swf_internal_t* i) /* The pre-processing of sound samples in getSamples(..) above re-samples the sound to swf_mp3_in_samplerate. It is best to simply make it the original samplerate: */ - swf_mp3_in_samplerate = i->video->rate; + swf_mp3_in_samplerate = i->video->samplerate; /* first run - initialize */ swf_mp3_channels = 1;//i->video->channels; @@ -268,7 +268,7 @@ static void writeAudioForOneFrame(v2swf_internal_t* i) /* write num frames, max 1 block */ for(pos=0;posvideo, block1, blocksize * (double)swf_mp3_in_samplerate/swf_mp3_out_samplerate, speedup)) { - i->video->rate = i->video->channels = 0; //end of soundtrack + i->video->samplerate = i->video->channels = 0; //end of soundtrack return; } if(!pos) {