On Sat, July 10, 2010 2:27 pm, Yang Zhe wrote: > I see it is because of the below change in libavcodec/util.c, > - avctx->codec_id = codec->id; > + if ((avctx->codec_type == CODEC_TYPE_UNKNOWN || avctx->codec_type > == codec->type) && > + avctx->codec_id == CODEC_ID_NONE) { > + avctx->codec_type = codec->type; > + avctx->codec_id = codec->id; > + } > + if(avctx->codec_id != codec->id || avctx->codec_type != codec->type){ > + av_log(avctx, AV_LOG_ERROR, "codec type or id mismatches\n"); > + goto free_and_end; > + } > > but I can't understand that in xmms2-0.7DrNo/src/plugins/avcodec/avcodec.c > > data->codecctx = g_new0 (AVCodecContext, 1); > > is initialized to zero. In avcodec_open() function it should go into > the first if clause. why not.
This seems to be bug 2332 ( http://bugs.xmms2.xmms.se/view.php?id=2332 ). It is fixed in devel ( http://git.xmms.se/?p=xmms2-devel.git;a=commit;h=71666f5ac8465fc40c8220043174f45e7088c3f0 ). Maybe it is neater to use avcodec_alloc_context() as suggested in avcodec.h at avcodec_open (and at http://wiki.aasimon.org/doku.php?id=ffmpeg:avcodec_open ) instead of g_new0 to make sure such a bug will not show up again with a new version of avcodec. (Also it doesn't seem data->codecctx is freed anywhere?) Regards, Erik Massop / nesciens -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org