summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2008-01-22 19:53:33 +0000
committerjbrjake <[email protected]>2008-01-22 19:53:33 +0000
commit4b36eaae98f6b2ac260f3ee741f22c7f07bcb7ad (patch)
tree566da627b82df9c439defb3ff6e2bdfb80c3a0ba /libhb/hb.c
parent9f7c6f5bd3eb26e1bbaafa535aa7f2f600e4ab56 (diff)
Maintains separate filter settings for each job. This prevents the MacGui from using the same filter settings for every job in the queue. Patch from travistex.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1228 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index 6c2e5034f..9f1b6bec9 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -935,8 +935,22 @@ void hb_add( hb_handle_t * h, hb_job_t * job )
job_copy->filters = hb_list_init();
for( i = 0; i < filter_count; i++ )
{
+ /*
+ * Copy the filters, since the MacGui reuses the global filter objects
+ * meaning that queued up jobs overwrite the previous filter settings.
+ * In reality, settings is probably the only field that needs duplicating
+ * since it's the only value that is ever changed. But name is duplicated
+ * as well for completeness. Not copying private_data since it gets
+ * created for each job in renderInit.
+ */
hb_filter_object_t * filter = hb_list_item( job->filters, i );
- hb_list_add( job_copy->filters, filter );
+ hb_filter_object_t * filter_copy = malloc( sizeof( hb_filter_object_t ) );
+ memcpy( filter_copy, filter, sizeof( hb_filter_object_t ) );
+ if( filter->name )
+ filter_copy->name = strdup( filter->name );
+ if( filter->settings )
+ filter_copy->settings = strdup( filter->settings );
+ hb_list_add( job_copy->filters, filter_copy );
}
}