[FFmpeg-devel] MAX_THREADS for ffmpeg-mt mp4
Fri Sep 25 00:12:28 CEST 2009
On Thu, Sep 24, 2009 at 01:04:33PM -0700, Frank Barchard wrote:
> On Thu, Sep 24, 2009 at 3:48 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Wed, Sep 23, 2009 at 01:43:17PM -0700, Frank Barchard wrote:
> > > Attached as a separate patch for just libavcodec/h264.c
> > >
> > > The other formats that use MAX_THREADS already had a check, so I
> > > copied this from dnxhdenc.c
> > > This prevents the crash, but is a fatal error:
> > > [h264 @ 0x2873030]too many threads
> > > [h264 @ 0x2873030]decode_slice_header error
> > not the right place, it should be in decode_init() or something called
> > by it
> Its not ideal, but thats where dnxhd.c does it.
> I considered putting it in avcodec_thread_init, which allows for
> graceful failure. ie
> if (avcodec_thread_init(codec_context, video_threads) < 0)
> // warning
> but avcodec_thread_init is implemented in 4 places: beosthread,
> os2thread, pthread, and w32thread.
> Perhaps decode_init() should clamp the video_threads to max, output a
> warning, but continue?
no, it should fail hard, the code should not second guess the user but rather
tell her about the problem and let her decide what to do to resolve it
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I have often repented speaking, but never of holding my tongue.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel