]> granicus.if.org Git - handbrake/commitdiff
Fixed some macgui code that looks to have been inadvertently removed.
authorsr55 <sr55.hb@outlook.com>
Sat, 16 Mar 2013 18:31:08 +0000 (18:31 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 16 Mar 2013 18:31:08 +0000 (18:31 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/opencl@5334 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/common.c
libhb/cropscale.c
libhb/oclnv12toyuv.h

index d22b2aebd86d6aae0677bee6947c8c9025bbff09..a519974ce7a0b7904492180e3f186157801922ba 100644 (file)
@@ -1791,6 +1791,42 @@ 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 )
@@ -1955,7 +1991,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);
     }
 }
 
index 12d50f9a50e52b04fe55339da2c6e4d13b4aa0b3..28e8220f28d3391e1d47718e284064b312e9655d 100644 (file)
@@ -162,6 +162,7 @@ static void hb_crop_scale_close( hb_filter_object_t * filter )
     free( pv );
     filter->private_data = NULL;
 }
+
 #ifdef USE_OPENCL
 static uint8_t *copy_plane( uint8_t *dst, uint8_t* src, int dstride, int sstride, int h )
 {
@@ -180,6 +181,7 @@ static uint8_t *copy_plane( uint8_t *dst, uint8_t* src, int dstride, int sstride
     return dst;
 }
 #endif
+
 static hb_buffer_t* crop_scale( hb_filter_private_t * pv, hb_buffer_t * in )
 {
     AVPicture           pic_in;
index 7dc104cff02e840a6af2246fad5bf5a369835e34..86f7673bbc14581138c5fbe2dfa7d6e54fb959ba 100644 (file)
@@ -24,8 +24,6 @@
 #include "common.h"
 #include "openclwrapper.h"
 
-
-
 /**
  * nv12 to yuv interface
  * bufi is input frame of nv12, w is input frame width, h is input frame height