diff options
author | Rodeo <[email protected]> | 2013-06-06 01:49:44 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2013-06-06 01:49:44 +0000 |
commit | df64236ebb447ae22b045ca6a88153b28b0a9b0d (patch) | |
tree | 1f35cd4a2a538c925c5de5d0e0c75743475ef3c6 /libhb/hb.c | |
parent | fa78c4e17d802bbee2161a225910d2651e9d9475 (diff) |
libhb: move one-time registrations to hb_global_init().
There's no need to do this in each call to hb_init().
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5566 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 95 |
1 files changed, 33 insertions, 62 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index bf8845609..a55575f8e 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -436,42 +436,11 @@ hb_handle_t * hb_init( int verbose, int update_check ) h->interjob = calloc( sizeof( hb_interjob_t ), 1 ); - /* libavcodec */ - hb_avcodec_init(); - /* Start library thread */ hb_log( "hb_init: starting libhb thread" ); h->die = 0; h->main_thread = hb_thread_init( "libhb", thread_func, h, HB_NORMAL_PRIORITY ); - hb_register( &hb_sync_video ); - hb_register( &hb_sync_audio ); - hb_register( &hb_decmpeg2 ); - hb_register( &hb_decvobsub ); - hb_register( &hb_encvobsub ); - hb_register( &hb_deccc608 ); - hb_register( &hb_decsrtsub ); - hb_register( &hb_decutf8sub ); - hb_register( &hb_dectx3gsub ); - hb_register( &hb_decssasub ); - hb_register( &hb_decpgssub ); - hb_register( &hb_encavcodec ); - hb_register( &hb_encx264 ); - hb_register( &hb_enctheora ); - hb_register( &hb_deca52 ); - hb_register( &hb_decavcodeca ); - hb_register( &hb_decavcodecv ); - hb_register( &hb_declpcm ); - hb_register( &hb_encfaac ); - hb_register( &hb_enclame ); - hb_register( &hb_encvorbis ); - hb_register( &hb_muxer ); -#ifdef __APPLE__ - hb_register( &hb_encca_aac ); - hb_register( &hb_encca_haac ); -#endif - hb_register( &hb_encavcodeca ); - hb_register( &hb_reader ); return h; } @@ -537,43 +506,12 @@ hb_handle_t * hb_init_dl( int verbose, int update_check ) h->pause_lock = hb_lock_init(); - /* libavcodec */ - hb_avcodec_init(); - /* Start library thread */ hb_log( "hb_init: starting libhb thread" ); h->die = 0; h->main_thread = hb_thread_init( "libhb", thread_func, h, HB_NORMAL_PRIORITY ); - hb_register( &hb_sync_video ); - hb_register( &hb_sync_audio ); - hb_register( &hb_decmpeg2 ); - hb_register( &hb_decvobsub ); - hb_register( &hb_encvobsub ); - hb_register( &hb_deccc608 ); - hb_register( &hb_decsrtsub ); - hb_register( &hb_decutf8sub ); - hb_register( &hb_dectx3gsub ); - hb_register( &hb_decssasub ); - hb_register( &hb_encavcodec ); - hb_register( &hb_encx264 ); - hb_register( &hb_enctheora ); - hb_register( &hb_deca52 ); - hb_register( &hb_decavcodeca ); - hb_register( &hb_decavcodecv ); - hb_register( &hb_declpcm ); - hb_register( &hb_encfaac ); - hb_register( &hb_enclame ); - hb_register( &hb_encvorbis ); - hb_register( &hb_muxer ); -#ifdef __APPLE__ - hb_register( &hb_encca_aac ); - hb_register( &hb_encca_haac ); -#endif - hb_register( &hb_encavcodeca ); - hb_register( &hb_reader ); - return h; } @@ -1679,6 +1617,39 @@ int hb_global_init() hb_error("Platform specific initialization failed!"); return -1; } + + /* libavcodec */ + hb_avcodec_init(); + + /* HB work objects */ + hb_register(&hb_muxer); + hb_register(&hb_reader); + hb_register(&hb_sync_video); + hb_register(&hb_sync_audio); + hb_register(&hb_deca52); + hb_register(&hb_decavcodecv); + hb_register(&hb_decavcodeca); + hb_register(&hb_declpcm); + hb_register(&hb_deccc608); + hb_register(&hb_decmpeg2); + hb_register(&hb_decpgssub); + hb_register(&hb_decsrtsub); + hb_register(&hb_decssasub); + hb_register(&hb_dectx3gsub); + hb_register(&hb_decutf8sub); + hb_register(&hb_decvobsub); + hb_register(&hb_encvobsub); + hb_register(&hb_encavcodec); + hb_register(&hb_encavcodeca); +#ifdef __APPLE__ + hb_register(&hb_encca_aac); + hb_register(&hb_encca_haac); +#endif + hb_register(&hb_encfaac); + hb_register(&hb_enclame); + hb_register(&hb_enctheora); + hb_register(&hb_encvorbis); + hb_register(&hb_encx264); hb_common_global_init(); |