summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-03-18 15:28:47 +0000
committerjstebbins <[email protected]>2015-03-18 15:28:47 +0000
commit55951f9621a488a38f76c01ccd804a46f2a92ae6 (patch)
tree8a7f908a89a8a5376460855c06532186456eb783
parentb13dba524acb20dcb8533246563fb8ae7a2a1a33 (diff)
rendersub: remove unnecessary filter settings
crop comes from job during post_init so isn't necessary. also, fix frame size (again) :( git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7001 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/rendersub.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/libhb/rendersub.c b/libhb/rendersub.c
index ba94e582f..960609aef 100644
--- a/libhb/rendersub.c
+++ b/libhb/rendersub.c
@@ -511,7 +511,9 @@ static int ssa_post_init( hb_filter_object_t * filter, hb_job_t * job )
return 1;
}
- ass_set_frame_size( pv->renderer, job->width, job->height);
+ int height = job->title->geometry.height - job->crop[0] - job->crop[1];
+ int width = job->title->geometry.width - job->crop[2] - job->crop[3];
+ ass_set_frame_size( pv->renderer, width, height);
double par = (double)job->par.num / job->par.den;
ass_set_aspect_ratio( pv->renderer, 1, par );
@@ -591,7 +593,9 @@ static int textsub_post_init( hb_filter_object_t * filter, hb_job_t * job )
{
// Text subtitles for which we create a dummy ASS header need
// to have the header rewritten with the correct dimensions.
- hb_subtitle_add_ssa_header(filter->subtitle, job->width, job->height);
+ int height = job->title->geometry.height - job->crop[0] - job->crop[1];
+ int width = job->title->geometry.width - job->crop[2] - job->crop[3];
+ hb_subtitle_add_ssa_header(filter->subtitle, width, height);
return ssa_post_init(filter, job);
}
@@ -826,16 +830,6 @@ static int hb_rendersub_init( hb_filter_object_t * filter,
hb_subtitle_t *subtitle;
int ii;
- pv->crop[0] = pv->crop[1] = pv->crop[2] = pv->crop[3] = -1;
- if( filter->settings )
- {
- sscanf( filter->settings, "%d:%d:%d:%d",
- &pv->crop[0],
- &pv->crop[1],
- &pv->crop[2],
- &pv->crop[3]);
- }
-
// Find the subtitle we need
for( ii = 0; ii < hb_list_count(init->job->list_subtitle); ii++ )
{
@@ -860,14 +854,10 @@ static int hb_rendersub_post_init( hb_filter_object_t * filter, hb_job_t *job )
{
hb_filter_private_t * pv = filter->private_data;
- if (pv->crop[0] == -1)
- pv->crop[0] = job->crop[0];
- if (pv->crop[1] == -1)
- pv->crop[1] = job->crop[1];
- if (pv->crop[2] == -1)
- pv->crop[2] = job->crop[2];
- if (pv->crop[3] == -1)
- pv->crop[3] = job->crop[3];
+ pv->crop[0] = job->crop[0];
+ pv->crop[1] = job->crop[1];
+ pv->crop[2] = job->crop[2];
+ pv->crop[3] = job->crop[3];
switch( pv->type )
{