[xiph-commits] r6994 - trunk/ffmpeg2theora
j at dactyl.lonelymoon.com
j
Mon Jul 5 07:24:21 PDT 2004
Author: j
Date: Mon Jul 5 07:24:21 2004
New Revision: 6994
Modified:
trunk/ffmpeg2theora/ffmpeg2theora.c
Log:
make aspect ratio more presice, to work with patch send to mplayer-dev
Modified: trunk/ffmpeg2theora/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/ffmpeg2theora.c 2004-07-05 11:39:23 UTC (rev 6993)
+++ trunk/ffmpeg2theora/ffmpeg2theora.c 2004-07-05 14:24:19 UTC (rev 6994)
@@ -58,8 +58,8 @@
double fps;
ImgReSampleContext *img_resample_ctx; /* for image resampling/resizing */
ReSampleContext *audio_resample_ctx;
- double aspect_numerator;
- double aspect_denominator;
+ ogg_uint32_t aspect_numerator;
+ ogg_uint32_t aspect_denominator;
int video_quality;
}
*ff2theora;
@@ -138,20 +138,16 @@
fps = (double) venc->frame_rate / venc->frame_rate_base;
#ifdef FFMPEGCVS
if(venc->sample_aspect_ratio.num!=0){
- //the way vlc is doing it right now.
- //this->aspect_numerator=venc->sample_aspect_ratio.num*(float)venc->width;
- //this->aspect_denominator=venc->sample_aspect_ratio.den*(float)venc->height;
this->aspect_numerator=venc->sample_aspect_ratio.num;
this->aspect_denominator=venc->sample_aspect_ratio.den;
//fprintf(stderr," Aspect %.2f/1\n",this->aspect_numerator/this->aspect_denominator);
}
#else
if(venc->aspect_ratio!=0){
- //this->aspect_numerator=venc->aspect_ratio*10000;
- //this->aspect_denominator=10000;
- this->aspect_numerator=(venc->aspect_ratio/(float)venc->width)*10000;
- this->aspect_denominator=10000/(float)venc->height;
- //fprintf(stderr," Aspect %.2f/1\n",this->aspect_numerator/this->aspect_denominator);
+ this->aspect_numerator=(int)(venc->aspect_ratio*100000*venc->width);
+ this->aspect_denominator=(int)100000*venc->height;
+ //fprintf(stderr," Aspect %d/%d\n",this->aspect_numerator,this->aspect_denominator);
+ //fprintf(stderr," Aspect %.2f/1\n",(float)this->aspect_numerator/this->aspect_denominator);
}
#endif
More information about the commits
mailing list