diff options
author | jstebbins <[email protected]> | 2010-01-20 21:17:27 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-01-20 21:17:27 +0000 |
commit | c5f4eea4c283771274b22ccf80fbb2af7e6f681f (patch) | |
tree | 61be212bf1ce2a8895ba185261ccabf9f87af442 | |
parent | 8d85eac5e739572e79f846059991ad31e9cd6774 (diff) |
fix cancel during p-to-p search
when canceling, video sync was closed, but audio sync was stuck waiting
on a condition variable. so force audio sync to wake up when video sync
closes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3078 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/hb-backend.c | 14 | ||||
-rw-r--r-- | libhb/sync.c | 5 |
2 files changed, 11 insertions, 8 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 44de3c2d9..fb76aa7c2 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3166,6 +3166,7 @@ ghb_track_status() hb_status.queue.state &= ~GHB_STATE_MUXING; hb_status.queue.state &= ~GHB_STATE_PAUSED; hb_status.queue.state &= ~GHB_STATE_WORKING; + hb_status.queue.state &= ~GHB_STATE_SEARCHING; switch (p.error) { case HB_ERROR_NONE: @@ -4318,22 +4319,19 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) chapters = ghb_settings_get_value(js, "chapter_list"); count = ghb_array_len(chapters); - for(chap = start; chap <= end; chap++) + for(chap = 0; chap < count; chap++) { hb_chapter_t * chapter_s; gchar *name; name = NULL; - if (chap-1 < count) - { - chapter = ghb_array_get_nth(chapters, chap-1); - name = ghb_value_string(chapter); - } + chapter = ghb_array_get_nth(chapters, chap); + name = ghb_value_string(chapter); if (name == NULL) { - name = g_strdup_printf ("Chapter %2d", chap); + name = g_strdup_printf ("Chapter %2d", chap+1); } - chapter_s = hb_list_item( job->title->list_chapter, chap - 1); + chapter_s = hb_list_item( job->title->list_chapter, chap); strncpy(chapter_s->title, name, 1023); chapter_s->title[1023] = '\0'; g_free(name); diff --git a/libhb/sync.c b/libhb/sync.c index 58fba19dc..31c9583ab 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -197,6 +197,11 @@ void syncVideoClose( hb_work_object_t * w ) hb_job_t * job = pv->job; hb_sync_video_t * sync = &pv->type.video; + // Wake up audio sync if it's still waiting on condition. + pv->common->pts_offset = 0; + pv->common->start_found = 1; + hb_cond_broadcast( pv->common->next_frame ); + if( sync->cur ) { hb_buffer_close( &sync->cur ); |