From 20b2389e3096aef6ba3deb08806131675e7c4215 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Mon, 17 Dec 2012 10:12:48 +0000 Subject: 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 --- libhb/common.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'libhb') 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); } } -- cgit v1.2.3