summaryrefslogtreecommitdiffstats
path: root/test/test.c
diff options
context:
space:
mode:
authoreddyg <[email protected]>2007-08-27 22:06:37 +0000
committereddyg <[email protected]>2007-08-27 22:06:37 +0000
commit629a658bc0afc640ed599637832c201711b5f1bd (patch)
tree1ce2a395fe48cec25dbe36953b5ff772f51cff28 /test/test.c
parent9f3728e88693ae501dce5a83d7d2852566167238 (diff)
Enable jam to work by changing the error handling to use a callback rather than a direct call outside of libhb.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@880 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/test/test.c b/test/test.c
index 49b787a3b..8694dc085 100644
--- a/test/test.c
+++ b/test/test.c
@@ -77,6 +77,17 @@ static int ParseOptions( int argc, char ** argv );
static int CheckOptions( int argc, char ** argv );
static int HandleEvents( hb_handle_t * h );
+/****************************************************************************
+ * hb_error_handler
+ *
+ * When using the CLI just display using hb_log as we always did in the past
+ * make sure that we prefix with a nice ERROR message to catch peoples eyes.
+ ****************************************************************************/
+static void hb_cli_error_handler ( const char *errmsg )
+{
+ hb_log( "ERROR: %s", errmsg );
+}
+
int main( int argc, char ** argv )
{
hb_handle_t * h;
@@ -90,6 +101,9 @@ int main( int argc, char ** argv )
return 1;
}
+ /* Register our error handler */
+ hb_register_error_handler(&hb_cli_error_handler);
+
/* Init libhb */
h = hb_init( debug, update );
@@ -1344,14 +1358,3 @@ static int CheckOptions( int argc, char ** argv )
return 0;
}
-
-/****************************************************************************
- * hb_error_handler
- *
- * When using the CLI just display using hb_log as we always did in the past
- * make sure that we prefix with a nice ERROR message to catch peoples eyes.
- ****************************************************************************/
-void hb_error_handler ( const char *errmsg )
-{
- hb_log( "ERROR: %s", errmsg );
-}