diff options
author | eddyg <[email protected]> | 2007-08-27 01:55:10 +0000 |
---|---|---|
committer | eddyg <[email protected]> | 2007-08-27 01:55:10 +0000 |
commit | 03d32783ea021b5ae8e744f094af90197294327a (patch) | |
tree | cf243fdee3f2d02359608be5b3816d6c38919105 /libhb/common.c | |
parent | d5e4f2a6c2d7a32529866692ec70720fd787808a (diff) |
Added rudimentory error handling to HB. Instead of using hb_log() use hb_error(). Also causes us to stop muxing when we get a write error in MP4 and MKV containers. Still requires macosx dialog box by dynaflash (see main.mm for stub to use).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@869 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/libhb/common.c b/libhb/common.c index d0b015505..45d207cb2 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -489,7 +489,7 @@ void hb_list_close( hb_list_t ** _l ) * hb_log ********************************************************************** * If verbose mode is one, print message with timestamp. Messages - * longer than 80 characters are stripped ;p + * longer than 180 characters are stripped ;p *********************************************************************/ void hb_log( char * log, ... ) { @@ -523,6 +523,31 @@ void hb_log( char * log, ... ) } /********************************************************************** + * hb_error + ********************************************************************** + * Using whatever output is available display this error. + *********************************************************************/ +void hb_error( char * log, ... ) +{ + char string[181]; /* 180 chars + \0 */ + time_t _now; + struct tm * now; + va_list args; + + extern void hb_error_handler(const char *errmsg); + + /* Convert the message to a string */ + va_start( args, log ); + vsnprintf( string, 180, log, args ); + va_end( args ); + + /* + * Got the error in a single string, send it off to be dispatched. + */ + hb_error_handler(string); +} + +/********************************************************************** * hb_title_init ********************************************************************** * |