]> granicus.if.org Git - handbrake/commitdiff
work: pass the crop settings to the subtitle renderer when adding it to the flter...
authorRodeo <tdskywalker@gmail.com>
Wed, 24 Apr 2013 19:56:47 +0000 (19:56 +0000)
committerRodeo <tdskywalker@gmail.com>
Wed, 24 Apr 2013 19:56:47 +0000 (19:56 +0000)
Fixes an issue where subtitles would not be re-positioned and be cut off.

Fix by John Stebbins.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5410 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/work.c

index b508f0929f0355fc7a1d5571311cfccdb537a0e3..45d341e7ddccae9d45ab7c02e3cf0fb43ccf3ea2 100644 (file)
@@ -665,17 +665,21 @@ static void do_job( hb_job_t * job )
              * Note: out.track starts at 1, i starts at 0 */
             subtitle->out_track = ++i;
         }
-        if ( one_burned )
+        if (one_burned)
         {
-            hb_filter_object_t * filter;
-
             // Add subtitle rendering filter
             // Note that if the filter is already in the filter chain, this
             // has no effect. Note also that this means the front-end is
             // not required to add the subtitle rendering filter since
             // we will always try to do it here.
-            filter = hb_filter_init(HB_FILTER_RENDER_SUB);
-            hb_add_filter( job, filter, NULL );
+            hb_filter_object_t *filter = hb_filter_init(HB_FILTER_RENDER_SUB);
+            char *filter_settings      = hb_strdup_printf("%d:%d:%d:%d",
+                                                          job->crop[0],
+                                                          job->crop[1],
+                                                          job->crop[2],
+                                                          job->crop[3]);
+            hb_add_filter(job, filter, filter_settings);
+            free(filter_settings);
         }
     }