{
hb_title_t * title;
+ // Check if scanning is necessary.
+ if (!strcmp(h->title_set.path, path))
+ {
+ // Current title_set path matches requested path.
+ // Check if the requested title has already been scanned.
+ int ii;
+ for (ii = 0; ii < hb_list_count(h->title_set.list_title); ii++)
+ {
+ title = hb_list_item(h->title_set.list_title, ii);
+ if (title->index == title_index)
+ {
+ // Title has already been scanned.
+ hb_lock( h->state_lock );
+ h->state.state = HB_STATE_SCANDONE;
+ hb_unlock( h->state_lock );
+ return;
+ }
+ }
+ }
+
h->scan_die = 0;
/* Clean up from previous scan */
"s:o,"
// Destination {Mux, ChapterMarkers, ChapterList}
"s:{s:o, s:o, s:[]},"
- // Source {Title, Angle}
- "s:{s:o, s:o,},"
+ // Source {Path, Title, Angle}
+ "s:{s:o, s:o, s:o,},"
// PAR {Num, Den}
"s:{s:o, s:o},"
// Video {Codec, QSV {Decode, AsyncDepth}}
"ChapterMarkers", hb_value_bool(job->chapter_markers),
"ChapterList",
"Source",
+ "Path", hb_value_string(job->title->path),
"Title", hb_value_int(job->title->index),
"Angle", hb_value_int(job->angle),
"PAR",
// Wait for scan to complete
hb_state_t state;
- do
+ hb_get_state2(h, &state);
+ while (state.state == HB_STATE_SCANNING)
{
hb_snooze(50);
hb_get_state2(h, &state);
- } while (state.state == HB_STATE_SCANNING);
+ }
}
static int validate_audio_codec_mux(int codec, int mux, int track)
title = hb_list_item( data->title_set->list_title, i );
title->flags |= HBTF_SCAN_COMPLETE;
}
+ if (hb_list_count(data->title_set->list_title) > 0)
+ {
+ strncpy(data->title_set->path, data->path, 1024);
+ data->title_set->path[1023] = 0;
+ }
+ else
+ {
+ data->title_set->path[0] = 0;
+ }
finish: