[libav-bugs] [Bug 580] av_guess_codec ignores parameters and returns surprising values

bugzilla at libav.org bugzilla at libav.org
Mon Oct 28 21:06:16 CET 2013


https://bugzilla.libav.org/show_bug.cgi?id=580

--- Comment #4 from Andrew Kelley <superjoe30 at gmail.com> 2013-10-28 21:06:15 CET ---
(In reply to comment #3)
> Well, since that function is not really documented, we can only guess what
> short_name is supposed to mean. IMO it wouldn't make much sense for it to be
> the _codec_ name, since then it'd just duplicate the relevant function from
> libavcodec. So I would assume that the author's intention was that it's the
> _muxer_ name.
> 
> In any case, patches documenting and improving that function are welcome.

I would be happy to do this. If I did, I would basically change av_guess_codec
to this (and then document it):


    AVCodec *codec = NULL;
    if (short_name) {
        codec = avcodec_find_encoder_by_name(short_name);
        if (!codec) {
            const AVCodecDescriptor *desc =
                avcodec_descriptor_get_by_name(short_name);
            if (desc) {
                codec = avcodec_find_encoder(desc->id);
            }
        }
    }
    if (!codec) {
        // do the previous logic that was in av_guess_codec
    }


But this seems against the comment you just made. Can you give more guidance as
to the direction you want av_guess_codec to go?

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list