[FFmpeg-devel] [PATCH] ffmpeg.c/ffplay.c redundantly set AVCodecContext.thread_count
Michael Dorr
dorr
Sun Feb 24 22:00:31 CET 2008
Am Sunday 24 February 2008 schrieb M?ns Rullg?rd:
> Michael Dorr <dorr at inb.uni-luebeck.de> writes:
>
> > Hi,
> >
> > AVCodecContext.thread_count is set in avcodec_thread_init already,
> > setting it again in ffmpeg.c/ffplay.c is redundant (and potentially
> > confusing).
> > Index: ffplay.c
> > ===================================================================
> > --- ffplay.c (revision 12190)
> > +++ ffplay.c (working copy)
> > @@ -1735,7 +1735,6 @@
> >
> > if(thread_count>1)
> > avcodec_thread_init(enc, thread_count);
> > - enc->thread_count= thread_count;
> > switch(enc->codec_type) {
> > case CODEC_TYPE_AUDIO:
> > is->audio_stream = stream_index;
>
> avcodec_thread_init() is only called if thread_count>1. Does it not
> need to be set in this case?
Ooops, right. AVCodecContext.thread_count is set to 1 by default in
avcodec_get_context_defaults2(). So, maybe this is better?
AVCodecContext.thread_count defaults to 1 or gets set correctly in
avcodec_thread_init, setting it again in ffmpeg.c/ffplay.c is redundant (and
potentially confusing).
Regards,
Michael
More information about the ffmpeg-devel
mailing list