[FFmpeg-devel] [PATCH]lavc/x264: Improve level setting

Michael Niedermayer michael at niedermayer.cc
Tue Jan 12 14:31:48 CET 2016


On Tue, Jan 12, 2016 at 02:10:08PM +0100, Carl Eugen Hoyos wrote:
> On Tuesday 12 January 2016 01:55:30 pm Michael Niedermayer wrote:
> > On Mon, Jan 11, 2016 at 10:58:55AM +0100, Carl Eugen Hoyos wrote:
> > > Hi!
> > >
> > > I guess that attached patch fixes the additional issue in ticket #3307.
> > >
> > > Please comment, Carl Eugen
> > >
> > >  libx264.c |    2 ++
> > >  1 file changed, 2 insertions(+)
> > > cea8163693a2a78b9dc2d1929082e7c76ac542ac  patchx264level.diff
> > > diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> > > index 88406a3..c1e52a1 100644
> > > --- a/libavcodec/libx264.c
> > > +++ b/libavcodec/libx264.c
> > > @@ -559,6 +559,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
> > >
> > >          if (!strcmp(x4->level, "1b")) {
> > >              level_id = 9;
> 
> > > +        } else if (atoi(x4->level) > 9) {
> 
> Should be "> 8".
> 
> > > +            level_id = atoi(x4->level);
> >
> > this should check that teres no "tail" after the integer
> 
> For which command line will this make a difference?
> I didn't find one...

didnt try but i was thinking of something like 11.8
whatever the user meant by that it likely shouldnt silently be
interpreted as 1.1, that could be rather confusing


> 
> New patch attached, Carl Eugen

>  libx264.c |    2 ++
>  1 file changed, 2 insertions(+)
> 00dbf2a3deee89c56aaa0743c3f5cb90f2e4b5e0  patchx264level.diff
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index 88406a3..abb6985 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -559,6 +559,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
>  
>          if (!strcmp(x4->level, "1b")) {
>              level_id = 9;
> +        } else if (av_strtod(x4->level, &tail) > 8.0 && !*tail) {

strtol or something


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160112/12fc91da/attachment.sig>


More information about the ffmpeg-devel mailing list