[x265] [PATCH 3 of 5] TEncTop: remove debugging exit() call

Rafaël Carré funman at videolan.org
Wed Sep 18 21:36:42 CEST 2013


Le 18/09/2013 20:52, Steve Borho a écrit :
> # HG changeset patch
> # User Steve Borho <steve at borho.org>
> # Date 1379525671 18000
> #      Wed Sep 18 12:34:31 2013 -0500
> # Node ID 165ef70557b68f44311bf689c825a4d2302de25a
> # Parent  0b1216d453cfb3660fb62d4dfedb9613158974ed
> TEncTop: remove debugging exit() call
> 
> diff -r 0b1216d453cf -r 165ef70557b6 source/Lib/TLibEncoder/TEncTop.cpp
> --- a/source/Lib/TLibEncoder/TEncTop.cpp	Wed Sep 18 12:23:52 2013 -0500
> +++ b/source/Lib/TLibEncoder/TEncTop.cpp	Wed Sep 18 12:34:31 2013 -0500
> @@ -87,10 +87,8 @@
>  {
>      if (!primitives.sad[0])
>      {
> -        printf("Primitives must be initialized before encoder is created\n");
> -        // we call exit() here because this should be an impossible condition when
> -        // using our public API, and indicates a serious bug.
> -        exit(1);
> +        // this should be an impossible condition when using our public API, and indicates a serious bug.
> +        x265_log(&param, X265_LOG_ERROR, "Primitives must be initialized before encoder is created\n");

What about:
assert(primitives.sad[0] && "Primitives must be initialized before
encoder is created");

?

It will print the message if the assert is triggered (and crash, which
indicates a "serious bug" :)

>      }
>  
>      m_frameEncoder = new FrameEncoder[param.frameNumThreads];


More information about the x265-devel mailing list