diff options
author | jstebbins <[email protected]> | 2012-12-17 10:12:48 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-12-17 10:12:48 +0000 |
commit | 20b2389e3096aef6ba3deb08806131675e7c4215 (patch) | |
tree | 68abdb2ef377913573ca2a69f58d878128e2dacf /libhb | |
parent | 6a14c28cf9ed9c5f7eb217bc25c4a736326d3c13 (diff) |
fix mac ui scaling problem after performing live preview encode
we can't touch the picture settings when resetting the job. the mac ui
currently depends on these remaining to what it set last.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5099 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/common.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/libhb/common.c b/libhb/common.c index 34c97da54..a76ce9017 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -1671,6 +1671,41 @@ void hb_title_close( hb_title_t ** _t ) *_t = NULL; } +// The mac ui expects certain fields of the job struct to be cleaned up +// and others to remain untouched. +// e.g. picture settings like cropping, width, height, should remain untouched. +// +// So only initialize job elements that we know get set up by prepareJob and +// prepareJobForPreview. +// +// This should all get resolved in some future mac ui refactoring. +static void job_reset_for_mac_ui( hb_job_t * job, hb_title_t * title ) +{ + if ( job == NULL || title == NULL ) + return; + + job->title = title; + + /* Set defaults settings */ + job->chapter_start = 1; + job->chapter_end = hb_list_count( title->list_chapter ); + job->list_chapter = hb_chapter_list_copy( title->list_chapter ); + + job->vcodec = HB_VCODEC_FFMPEG_MPEG4; + job->vquality = -1.0; + job->vbitrate = 1000; + job->pass = 0; + job->vrate = title->rate; + job->vrate_base = title->rate_base; + + job->list_audio = hb_list_init(); + job->list_subtitle = hb_list_init(); + job->list_filter = hb_list_init(); + + job->list_attachment = hb_attachment_list_copy( title->list_attachment ); + job->metadata = hb_metadata_copy( title->metadata ); +} + static void job_setup( hb_job_t * job, hb_title_t * title ) { if ( job == NULL || title == NULL ) @@ -1827,7 +1862,7 @@ void hb_job_reset( hb_job_t * job ) { hb_title_t * title = job->title; job_clean(job); - job_setup(job, title); + job_reset_for_mac_ui(job, title); } } |