[FFmpeg-devel] [PATCH] avcodec/utils: Warn if a codec is opened with a codec id without codec descriptor

Michael Niedermayer michaelni at gmx.at
Wed Jun 3 02:01:03 CEST 2015


On Tue, Jun 02, 2015 at 06:53:36PM +0200, wm4 wrote:
> On Mon, 1 Jun 2015 20:59:42 +0200
> Michael Niedermayer <michaelni at gmx.at> wrote:
> 
> > On Mon, Jun 01, 2015 at 08:30:33PM +0200, wm4 wrote:
> > > On Mon,  1 Jun 2015 20:27:11 +0200
> > > Michael Niedermayer <michaelni at gmx.at> wrote:
> > > 
> > > > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > > > ---
> > > >  libavcodec/utils.c |    2 ++
> > > >  1 file changed, 2 insertions(+)
> > > > 
> > > > diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> > > > index 7e3f92a..22e826f 100644
> > > > --- a/libavcodec/utils.c
> > > > +++ b/libavcodec/utils.c
> > > > @@ -1453,6 +1453,8 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
> > > >      }
> > > >      avctx->frame_number = 0;
> > > >      avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id);
> > > > +    if (!avctx->codec_descriptor)
> > > > +        av_log(avctx, AV_LOG_WARNING, "No codec descriptor found for codec_id\n");
> > > >  
> > > >      if (avctx->codec->capabilities & CODEC_CAP_EXPERIMENTAL &&
> > > >          avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
> > > 
> > > This shouldn't happen at all. Every CODEC_ID needs a descriptor.
> > 
> > i thought so too at first before writing this patch but
> > user applications might want to use their own codecs with their
> > own codec_ids and these would not have a descriptor
> > also requiring a descriptor breaks the fate-libavcodec-options
> > test
> 
> But uses can't provide their own codecs.

its a step toward making it possible

we could also instead add a codec_descriptor and codec_id for
the user to freely use one for audio, video and subtitles but it
would be limiting somehow



[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150603/b3fcd47e/attachment.asc>


More information about the ffmpeg-devel mailing list