summaryrefslogtreecommitdiffstats
path: root/libhb/work.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-05-14 17:03:15 +0000
committerRodeo <[email protected]>2012-05-14 17:03:15 +0000
commit0a46de5cf236dd05ac9cd18451f2fd23fc6419a7 (patch)
tree85210b97f25253e8027b2a6baa3cbd42b971c18c /libhb/work.c
parentc595d44bb21b9148a3a9e5ababc57bba5d05e5d7 (diff)
Foreign Audio Search: improve duplicate subtitle detection.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4679 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/work.c')
-rw-r--r--libhb/work.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libhb/work.c b/libhb/work.c
index 5f27156ee..0cb8fd13a 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -560,12 +560,15 @@ static void do_job( hb_job_t * job )
{
if( ( subtitle = hb_list_item( title->list_subtitle, i ) ) )
{
- /* Remove the scanned subtitle from the subtitle list if
- * it would result in an identical duplicate subtitle track
- * or an emty track (forced and no forced hits). */
+ /* Remove the scanned subtitle from the list if it would result in:
+ * - an emty track (forced and no forced hits)
+ * - an identical, duplicate subtitle track:
+ * -> both (or neither) are forced
+ * -> subtitle is not forced but all its hits are forced */
if( ( interjob->select_subtitle->id == subtitle->id ) &&
( ( subtitle->config.force && interjob->select_subtitle->forced_hits == 0 ) ||
- ( subtitle->config.force == interjob->select_subtitle->config.force ) ) )
+ ( subtitle->config.force == interjob->select_subtitle->config.force ) ||
+ ( subtitle->config.force == 0 && interjob->select_subtitle->hits == interjob->select_subtitle->forced_hits ) ) )
{
hb_list_rem( title->list_subtitle, subtitle );
free( subtitle );
@@ -573,8 +576,7 @@ static void do_job( hb_job_t * job )
}
/* Adjust output track number, in case we removed one.
* Output tracks sadly still need to be in sequential order.
- * Note: out.track starts at 1, i starts at 0, and track 1 is
- * interjob->select_subtitle */
+ * Note: out.track starts at 1, i starts at 0, and track 1 is interjob->select_subtitle */
subtitle->out_track = ++i + 1;
}
else