diff options
author | jbrjake <[email protected]> | 2009-06-04 17:52:01 +0000 |
---|---|---|
committer | jbrjake <[email protected]> | 2009-06-04 17:52:01 +0000 |
commit | a9eb0fba5299b12a951f2116276ef3382c1ff50a (patch) | |
tree | a4ee5ec78bca4077b8de2c522ee600824ff1696e /libhb/hb.c | |
parent | 2c5699a0b597b55a6c6f7cc663e473dd4a7345e1 (diff) |
Adds an interjob structure to preserve some encode data across jobs within an instance of libhb. This allows correcting the estimated bitrate/filesize of 2-pass encodes of variable framerate content, as the actual frame count is known after the first pass. Thanks for putting the idea into code, Shaya.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2482 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r-- | libhb/hb.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libhb/hb.c b/libhb/hb.c index aa6679193..f5caa8cd6 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -38,6 +38,11 @@ struct hb_handle_s /* For MacGui active queue increments each time the scan thread completes*/ int scanCount; + + /* Stash of persistent data between jobs, for stuff + like correcting frame count and framerate estimates + on multi-pass encodes where frames get dropped. */ + hb_interjob_t * interjob; }; @@ -142,6 +147,8 @@ hb_handle_t * hb_init( int verbose, int update_check ) h->pause_lock = hb_lock_init(); + h->interjob = calloc( sizeof( hb_interjob_t ), 1 ); + /* libavcodec */ hb_avcodec_init(); @@ -1475,3 +1482,9 @@ void hb_set_state( hb_handle_t * h, hb_state_t * s ) hb_unlock( h->state_lock ); hb_unlock( h->pause_lock ); } + +/* Passes a pointer to persistent data */ +hb_interjob_t * hb_interjob_get( hb_handle_t * h ) +{ + return h->interjob; +} |