All pastes #812976 Raw Edit

hb_copy()

public diff v1 · immutable
·published 2007-12-12 03:56 UTC
rendered paste body
Index: libhb/hb.c===================================================================--- libhb/hb.c	(revision 1116)+++ libhb/hb.c	(working copy)@@ -691,12 +691,10 @@     return( h->current_job ); } -/**- * Adds a job to the job list.- * @param h Handle to hb_handle_t.- * @param job Handle to hb_job_t.+/*+ * Copy the full job and title and return the copied job.  */-void hb_add( hb_handle_t * h, hb_job_t * job )+hb_job_t *hb_copy( hb_job_t * job ) {     hb_job_t      * job_copy;     hb_title_t    * title,    * title_copy;@@ -903,8 +901,6 @@     title_copy->job = job_copy;     job_copy->title = title_copy;     job_copy->file  = strdup( job->file );-    job_copy->h     = h;-    job_copy->pause = h->pause_lock;      /* Copy the job filter list */     if( job->filters )@@ -918,14 +914,33 @@             hb_list_add( job_copy->filters, filter );         }             }-    -    /* Add the job to the list */-    hb_list_add( h->jobs, job_copy );-    h->job_count = hb_count(h);-    h->job_count_permanent++;+    return( job_copy ); }  /**+ * Adds a job to the job list.+ * @param h Handle to hb_handle_t.+ * @param job Handle to hb_job_t.+ */+void hb_add( hb_handle_t * h, hb_job_t * job )+{+    hb_job_t * job_copy;++    job_copy = hb_copy( job );++    job_copy->h     = h;+    job_copy->pause = h->pause_lock;++    if( job_copy )+    {+        /* Add the job to the list */+        hb_list_add( h->jobs, job_copy );+        h->job_count = hb_count(h);+        h->job_count_permanent++;+    }+}++/**  * Removes a job from the job list.  * @param h Handle to hb_handle_t.  * @param job Handle to hb_job_t.Index: libhb/hb.h===================================================================--- libhb/hb.h	(revision 1116)+++ libhb/hb.h	(working copy)@@ -86,6 +86,7 @@ hb_job_t *    hb_current_job( hb_handle_t * h ); void          hb_add( hb_handle_t *, hb_job_t * ); void          hb_rem( hb_handle_t *, hb_job_t * );+hb_job_t *    hb_copy( hb_job_t * );  void          hb_start( hb_handle_t * ); void          hb_pause( hb_handle_t * );