diff options
author | jstebbins <[email protected]> | 2008-11-30 17:52:45 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-11-30 17:52:45 +0000 |
commit | a711b499a63d593c2aeb2cde879bdb6a0e41cf01 (patch) | |
tree | a52b2cd1f6e5e0ccea29a56d3632e27b1d8cd11b | |
parent | a596159c99a48b6702a37e2adee1382257cc156b (diff) |
LinGui: when setting up a live preview encode, ignore current chapter settings.
if all chapters aren't enabled, the encode exits without completing.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1977 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/hb-backend.c | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 0bf156b19..ba3eb8abc 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -2985,42 +2985,45 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) job->largeFileSize = FALSE; job->mp4_optimize = FALSE; } - gint chapter_start, chapter_end; - chapter_start = ghb_settings_get_int(js, "start_chapter"); - chapter_end = ghb_settings_get_int(js, "end_chapter"); - gint num_chapters = hb_list_count(title->list_chapter); - job->chapter_start = MIN( num_chapters, chapter_start ); - job->chapter_end = MAX( job->chapter_start, chapter_end ); - - job->chapter_markers = ghb_settings_get_boolean(js, "ChapterMarkers"); - if ( job->chapter_markers ) - { - GValue *chapters; - GValue *chapter; - gint chap; - gint count; + if (!job->start_at_preview) + { + gint chapter_start, chapter_end; + chapter_start = ghb_settings_get_int(js, "start_chapter"); + chapter_end = ghb_settings_get_int(js, "end_chapter"); + gint num_chapters = hb_list_count(title->list_chapter); + job->chapter_start = MIN( num_chapters, chapter_start ); + job->chapter_end = MAX( job->chapter_start, chapter_end ); + + job->chapter_markers = ghb_settings_get_boolean(js, "ChapterMarkers"); + if ( job->chapter_markers ) + { + GValue *chapters; + GValue *chapter; + gint chap; + gint count; - chapters = ghb_settings_get_value(js, "chapter_list"); - count = ghb_array_len(chapters); - for(chap = chapter_start; chap <= chapter_end; chap++) - { - hb_chapter_t * chapter_s; - gchar *name; - - name = NULL; - if (chap-1 < count) + chapters = ghb_settings_get_value(js, "chapter_list"); + count = ghb_array_len(chapters); + for(chap = chapter_start; chap <= chapter_end; chap++) { - chapter = ghb_array_get_nth(chapters, chap-1); - name = ghb_value_string(chapter); - } - if (name == NULL) - { - name = g_strdup_printf ("Chapter %2d", 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); + } + if (name == NULL) + { + name = g_strdup_printf ("Chapter %2d", chap); + } + chapter_s = hb_list_item( job->title->list_chapter, chap - 1); + strncpy(chapter_s->title, name, 1023); + chapter_s->title[1023] = '\0'; + g_free(name); } - chapter_s = hb_list_item( job->title->list_chapter, chap - 1); - strncpy(chapter_s->title, name, 1023); - chapter_s->title[1023] = '\0'; - g_free(name); } } job->crop[0] = ghb_settings_get_int(js, "PictureTopCrop"); |