summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-09-06 22:43:10 +0000
committerjstebbins <[email protected]>2008-09-06 22:43:10 +0000
commit5917f628bf5aa7d6c19aa4bb67588ef064dc709c (patch)
tree7b3b6a45fa87399a7683b2fb18f0cdbc5c6dbddf /gtk/src/hb-backend.c
parent74961ccaa30bdf49516c89755e4b2a34e87c18fc (diff)
LinGui: Fix a crash with re-scanning prior to encoding. Incorrect title
index was being used. Must be sure to use title->index for this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1672 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index eb60ad95a..8054320e5 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -683,6 +683,25 @@ ghb_hb_cleanup(gboolean partial)
del_tree(dir, !partial);
}
+gint
+ghb_get_title_number(gint titleindex)
+{
+ hb_list_t * list;
+ hb_title_t * title;
+ hb_audio_config_t *audio = NULL;
+
+ if (h_scan == NULL) return 1;
+ list = hb_get_titles( h_scan );
+ if( !hb_list_count( list ) )
+ {
+ /* No valid title, stop right there */
+ return NULL;
+ }
+ title = hb_list_item( list, titleindex );
+ if (title == NULL) return 1; // Bad titleindex
+ return title->index;
+}
+
static hb_audio_config_t*
get_hb_audio(gint titleindex, gint track)
{
@@ -1682,10 +1701,10 @@ ghb_backend_scan(const gchar *path, gint titleindex)
}
void
-ghb_backend_queue_scan(const gchar *path, gint titleindex)
+ghb_backend_queue_scan(const gchar *path, gint titlenum)
{
g_debug("ghb_backend_queue_scan()");
- hb_scan( h_queue, path, titleindex );
+ hb_scan( h_queue, path, titlenum );
hb_status.queue_state |= GHB_STATE_SCANNING;
}