The fix is a little bit more complicated than '.' to '->'.
I have attached a patch to correct this.
And yes I guess upgrading to version 0.15 should be better but
apparently it does not compile under current debian testing (dont have
tried unstable).
--
Henry PrĂȘcheur
diff -ru ffmpeg2theora-0.13+svn20050704/ffmpeg2theora.c
ffmpeg2theora-0.13+svn20050704.fixed/ffmpeg2theora.c
--- ffmpeg2theora-0.13+svn20050704/ffmpeg2theora.c 2005-07-04
23:15:49.000000000 +0200
+++ ffmpeg2theora-0.13+svn20050704.fixed/ffmpeg2theora.c 2006-01-24
23:42:00.000000000 +0100
@@ -128,7 +128,7 @@
if(this->audiostream >= 0 && this->context->nb_streams >
this->audiostream) {
- AVCodecContext *enc =
&this->context->streams[this->audiostream]->codec;
+ AVCodecContext *enc = this->context->streams[this->audiostream]->codec;
if (enc->codec_type == CODEC_TYPE_AUDIO) {
this->audio_index = this->audiostream;
fprintf(stderr," Using stream #0.%d as audio
input\n",this->audio_index);
@@ -139,7 +139,7 @@
}
for (i = 0; i < this->context->nb_streams; i++){
- AVCodecContext *enc = &this->context->streams[i]->codec;
+ AVCodecContext *enc = this->context->streams[i]->codec;
switch (enc->codec_type){
case CODEC_TYPE_VIDEO:
if (this->video_index < 0)
@@ -156,7 +156,7 @@
if (this->video_index >= 0){
vstream = this->context->streams[this->video_index];
- venc = &this->context->streams[this->video_index]->codec;
+ venc = this->context->streams[this->video_index]->codec;
vcodec = avcodec_find_decoder (venc->codec_id);
#if LIBAVFORMAT_BUILD <= 4623
@@ -234,8 +234,8 @@
int
width=venc->width-this->frame_leftBand-this->frame_rightBand;
int
height=venc->height-this->frame_topBand-this->frame_bottomBand;
av_reduce(&this->aspect_numerator,&this->aspect_denominator,
- venc->sample_aspect_ratio.num*width*this->picture_height,
-
venc->sample_aspect_ratio.den*height*this->picture_width,10000);
+
venc->sample_aspect_ratio.num*width*this->picture_height,
+
venc->sample_aspect_ratio.den*height*this->picture_width,10000);
frame_aspect=(float)(this->aspect_numerator*this->picture_width)/
(this->aspect_denominator*this->picture_height);
}
@@ -298,7 +298,7 @@
if (this->audio_index >= 0){
astream = this->context->streams[this->audio_index];
- aenc = &this->context->streams[this->audio_index]->codec;
+ aenc = this->context->streams[this->audio_index]->codec;
acodec = avcodec_find_decoder (aenc->codec_id);
if (this->channels != aenc->channels && aenc->codec_id == CODEC_ID_AC3)
aenc->channels = this->channels;
@@ -350,14 +350,14 @@
info.video_only=1;
if(!info.audio_only){
- frame = alloc_picture(vstream->codec.pix_fmt,
- vstream->codec.width,vstream->codec.height);
- frame_tmp = alloc_picture(vstream->codec.pix_fmt,
- vstream->codec.width,vstream->codec.height);
+ frame = alloc_picture(vstream->codec->pix_fmt,
+ vstream->codec->width,vstream->codec->height);
+ frame_tmp = alloc_picture(vstream->codec->pix_fmt,
+ vstream->codec->width,vstream->codec->height);
output_tmp =alloc_picture(PIX_FMT_YUV420P,
- vstream->codec.width,vstream->codec.height);
+ vstream->codec->width,vstream->codec->height);
output =alloc_picture(PIX_FMT_YUV420P,
- vstream->codec.width,vstream->codec.height);
+ vstream->codec->width,vstream->codec->height);
output_resized =alloc_picture(PIX_FMT_YUV420P,
this->frame_width, this->frame_height);
output_buffered =alloc_picture(PIX_FMT_YUV420P,
@@ -461,7 +461,7 @@
while(e_o_s || len > 0){
int dups = 0;
if(len >0 &&
- (len1 = avcodec_decode_video(&vstream->codec,
+ (len1 = avcodec_decode_video(vstream->codec,
frame,&got_picture, ptr, len))>0) {
if(got_picture){
@@ -480,7 +480,7 @@
break;
}
if (delta > 0.7) {
- dups = lrintf(delta);
+ dups = (int)(delta);
fprintf(stderr,
"%d duplicate %s added to maintain
sync\n",
dups, (dups == 1) ? "frame" : "frames");
@@ -546,7 +546,7 @@
int samples_out=0;
int data_size;
if(len > 0){
- len1 = avcodec_decode_audio(&astream->codec,
audio_buf,&data_size, ptr, len);
+ len1 = avcodec_decode_audio(astream->codec,
audio_buf,&data_size, ptr, len);
if (len1 < 0){
/* if error, we skip the frame */
break;