]> granicus.if.org Git - handbrake/commitdiff
libhb: force title rescan after completing a job encode (#488)
authorJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 16 Jan 2017 22:54:13 +0000 (14:54 -0800)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Sat, 21 Jan 2017 21:46:16 +0000 (13:46 -0800)
Fixes https://forum.handbrake.fr/viewtopic.php?f=12&t=35583
(cherry picked from commit 922db9bec26e1def4c8ba60afb2147cc06ec524d)

libhb/hb.c
libhb/hb.h
libhb/work.c

index 562f0dc7028797390b9d899edfd62cb61064f530..f8bba2a66bab644653673010e5b979fd95282f6d 100644 (file)
@@ -659,6 +659,11 @@ void hb_scan( hb_handle_t * h, const char * path, int title_index,
                                    store_previews, min_duration );
 }
 
+void hb_force_rescan( hb_handle_t * h )
+{
+    h->title_set.path[0] = 0;
+}
+
 /**
  * Returns the list of titles found.
  * @param h Handle to hb_handle_t
index 86fed9bc0d48eea7a884460c3df3c5f3df48f605..fd8061431e8a203f986af38e3d7eaff904286278 100644 (file)
@@ -58,6 +58,7 @@ void          hb_scan( hb_handle_t *, const char * path,
                        int title_index, int preview_count,
                        int store_previews, uint64_t min_duration );
 void          hb_scan_stop( hb_handle_t * );
+void          hb_force_rescan( hb_handle_t * );
 uint64_t      hb_first_duration( hb_handle_t * );
 
 /* hb_get_titles()
index 3dfa03469718fd543893d6d3021b2f6fc0fac15d..8aa920860ee50b099cb3423ac3e0f5f6cf5ce2ad 100644 (file)
@@ -92,6 +92,8 @@ static void work_func( void * _work )
 
     while( !*work->die && ( job = hb_list_item( work->jobs, 0 ) ) )
     {
+        hb_handle_t * h = job->h;
+
         hb_list_rem( work->jobs, job );
         hb_list_t * passes = hb_list_init();
 
@@ -143,6 +145,10 @@ static void work_func( void * _work )
             hb_job_close(&job);
         }
         hb_list_close(&passes);
+
+        // Force rescan of next source processed by this hb_handle_t
+        // TODO: Fix this ugly hack!
+        hb_force_rescan(h);
     }
 
     free( work );