Skip to content

Commit

Permalink
fa_scanner: Take reference to directory URL before spawning thread.
Browse files Browse the repository at this point in the history
Will improve performance
  • Loading branch information
andoma committed Apr 30, 2011
1 parent e1b74f4 commit 6061b3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fileaccess/fa_scanner.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ scanner(void *aux)
{
scanner_t *s = aux;

s->s_ref = fa_reference(s->s_url);

if((s->s_fd = fa_scandir(s->s_url, NULL, 0)) != NULL) {
doscan(s);
fa_dir_free(s->s_fd);
Expand Down Expand Up @@ -541,6 +539,8 @@ fa_scanner(const char *url, prop_t *model, const char *playme)

s->s_refcount = 2; // One held by scanner thread, one by the subscription

s->s_ref = fa_reference(s->s_url);

hts_thread_create_detached("fa scanner", scanner, s, THREAD_PRIO_LOW);

prop_subscribe(PROP_SUB_TRACK_DESTROY,
Expand Down

0 comments on commit 6061b3e

Please sign in to comment.