diff options
author | jstebbins <[email protected]> | 2012-05-05 18:22:37 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-05-05 18:22:37 +0000 |
commit | 06254850dc2c1ec43d57f4d8e2026fa67967d5b9 (patch) | |
tree | c7ff6a64e1310d79f4f17b1a6bfe9aebaf88a958 /libhb/work.c | |
parent | 1c8309d77ea303954f8c9e3919c595de54f173f2 (diff) |
libhb: Fix problem with positions of burned-in subs
When cropping and/or scaling, the position of burned-in SSA subs was broken.
Also, when scaling, the position of all other burned-in subs was broken.
Part of this fix is to revert a bit of filter initialization changes that
were made in this commit https://trac.handbrake.fr/changeset/4605
The other part of the fix is to add cropping parameters to the initialization
of the subtitle rendering filter. This filter needs the *original* title
dimensions and the crop values in order to compute the positions properly.
The changes that I am reverting gave it the scaled job dimensions and the
crop values. This was wrong in so many ways it's embarassing :p
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4642 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/work.c')
-rw-r--r-- | libhb/work.c | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/libhb/work.c b/libhb/work.c index f237a0a9b..50596093f 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -504,47 +504,6 @@ void correct_framerate( hb_job_t * job ) interjob->vrate_base = job->vrate_base; } -void hb_filter_init_next( hb_list_t * list, int *score, int *ret_pos ) -{ - int count = hb_list_count( list ); - int pos = *ret_pos + 1; - int ii = 0; - if ( pos == 0 ) - { - hb_filter_object_t * filter = hb_list_item( list, pos ); - if ( filter->init_index == *score ) - { - *ret_pos = pos; - return; - } - pos++; - } - while (1) - { - if ( pos == count ) - { - pos = 0; - (*score)++; - ii = 0; - } - hb_filter_object_t * filter = hb_list_item( list, pos ); - if ( filter->init_index == *score ) - { - *ret_pos = pos; - return; - } - pos++; - ii++; - if (ii > count) - { - // This is an error that should never happen - hb_error("internal error during filter initialization"); - *ret_pos = -1; - return; - } - } -} - /** * Job initialization rountine. * Initializes fifos. @@ -723,7 +682,6 @@ static void do_job( hb_job_t * job ) if( job->list_filter && hb_list_count( job->list_filter ) ) { hb_filter_init_t init; - int pos = -1, score = 0; init.job = job; init.pix_fmt = PIX_FMT_YUV420P; @@ -737,19 +695,7 @@ static void do_job( hb_job_t * job ) init.cfr = 0; for( i = 0; i < hb_list_count( job->list_filter ); i++ ) { - // Some filters need to be initialized in a different order - // than they are executed in the pipeline. e.g. rendersub - // needs to be initialized after cropscale so that it knows - // the crop settings, but it needs to be executed before - // cropscale. so hb_filter_init_next() finds returns the - // position of filters in initialization order. - hb_filter_init_next( job->list_filter, &score, &pos ); - if( pos == -1) - { - // This is an error that should never happen! - break; - } - hb_filter_object_t * filter = hb_list_item( job->list_filter, pos ); + hb_filter_object_t * filter = hb_list_item( job->list_filter, i ); if( filter->init( filter, &init ) ) { hb_log( "Failure to initialise filter '%s', disabling", |