[FFmpeg-devel] [PATCH] x264_param_apply_profile from AVCodecContext.profile

Michael Niedermayer michaelni at gmx.at
Mon Sep 17 21:39:01 CEST 2012


On Sun, Sep 16, 2012 at 10:53:49PM +0300, Lyubomir Marinov wrote:
> Dear Michael,
> 
> On 15.09.2012, at 04:11, Michael Niedermayer <michaelni at gmx.at> wrote:
> > On Sat, Sep 15, 2012 at 01:05:00AM +0300, Lyubomir Marinov wrote:
> >> Dear FFmpeg developers,
> >> 
> >> We at jitsi.org would also like to enable specifying the profile to be used by the FFmpeg x264 encoder through the AVCodecContext.profile field in the style of the following patch:
> >> 
> > 
> >> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> >> index f2f8990..203f7af 100644
> >> --- a/libavcodec/libx264.c
> >> +++ b/libavcodec/libx264.c
> >> @@ -447,6 +447,18 @@ static av_cold int X264_init(AVCodecContext *avctx)
> >>     if (x4->fastfirstpass)
> >>         x264_param_apply_fastfirstpass(&x4->params);
> >> 
> >> +    /* Allow specifying the x264 profile through AVCodecContext. */
> >> +    if (!x4->profile)
> >> +        switch (avctx->profile) {
> >> +        case FF_PROFILE_H264_BASELINE:
> >> +            x4->profile = "baseline";
> >> +            break;
> >> +        case FF_PROFILE_H264_MAIN:
> >> +            x4->profile = "main";
> >> +            break;
> >> +        default:
> >> +            break;
> >> +        }
> > 
> > i think this is missing a av_strdup() if its implemented this way
> > that is as is it should crash with freeing an invalid pointer
> 
> Thank you very much!
> 
> The following patch uses av_strdup in accord with your note and supports more FF_PROFILE_H264_* values:

patch applied

thanks

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120917/8d3647aa/attachment.asc>


More information about the ffmpeg-devel mailing list