[FFmpeg-devel] [PATCH 1/2] lavc: add av_get_profile_name() to get profile names

Carl Eugen Hoyos cehoyos
Fri Jan 7 23:42:52 CET 2011


Michael Niedermayer <michaelni <at> gmx.at> writes:

> >  /**
> > + * Return a name for the specified profile, if available.
> > + *
> > + * @param codec the codec that is searched for the given profile
> > + * @param profile the profile value for which a name is requested
> > + * @return A name for the profile if found, NULL otherwise.
> > + */
> > +const char *av_get_profile_name(AVCodec *codec, int profile);
>                                    ^^^^^^^^^^^
> const
> 
> otherwise lgtm

Either I screwed up the commit, or the following (inlined) is necessary before
2/2 can be applied:

@@ -969,7 +978,7 @@
 const char *av_get_profile_name(const AVCodec *codec, int profile)
 {
     const AVProfile *p;
-    if (profile == FF_PROFILE_UNKNOWN || !codec->profiles)
+    if (profile == FF_PROFILE_UNKNOWN || !codec || !codec->profiles)
         return NULL;

     for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)

Carl Eugen

> [...]







More information about the ffmpeg-devel mailing list