[FFmpeg-devel] [PATCH] x264_param_apply_profile from AVCodecContext.profile
Michael Niedermayer
michaelni at gmx.at
Sat Sep 15 03:11:11 CEST 2012
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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- 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/20120915/49f6f5e7/attachment.asc>
More information about the ffmpeg-devel
mailing list