[x264-devel] Check pf_log is set in validate_parameters

Fiona Glaser git at videolan.org
Sun Jul 20 11:58:31 CEST 2014


x264 | branch: master | Fiona Glaser <fiona at x264.com> | Wed Jul  9 12:21:33 2014 -0700| [08d36b3fc975d049aa3786ca34fb0b2f2ba0007c] | committer: Fiona Glaser

Check pf_log is set in validate_parameters

Help remind people to call x264_param_default in case they didn't read the
documentation.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=08d36b3fc975d049aa3786ca34fb0b2f2ba0007c
---

 encoder/encoder.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index 5305f75..1ea341b 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -415,6 +415,12 @@ static void x264_encoder_thread_init( x264_t *h )
 
 static int x264_validate_parameters( x264_t *h, int b_open )
 {
+    if( !h->param.pf_log )
+    {
+        x264_log( NULL, X264_LOG_ERROR, "pf_log not set! did you forget to call x264_param_default?\n" );
+        return -1;
+    }
+
 #if HAVE_MMX
     if( b_open )
     {



More information about the x264-devel mailing list