diff options
Diffstat (limited to 'lib/rbcodec/metadata/metadata.c')
-rw-r--r-- | lib/rbcodec/metadata/metadata.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/lib/rbcodec/metadata/metadata.c b/lib/rbcodec/metadata/metadata.c index 6837e97316..3fe9860441 100644 --- a/lib/rbcodec/metadata/metadata.c +++ b/lib/rbcodec/metadata/metadata.c | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | #include "debug.h" | 26 | #include "debug.h" |
27 | #include "logf.h" | 27 | #include "logf.h" |
28 | #include "settings.h" | ||
29 | #include "cuesheet.h" | 28 | #include "cuesheet.h" |
30 | #include "metadata.h" | 29 | #include "metadata.h" |
31 | 30 | ||
@@ -571,67 +570,3 @@ void fill_metadata_from_path(struct mp3entry *id3, const char *trackname) | |||
571 | strlcpy(id3->path, trackname, sizeof (id3->path)); | 570 | strlcpy(id3->path, trackname, sizeof (id3->path)); |
572 | } | 571 | } |
573 | #endif /* CONFIG_CODEC == SWCODEC */ | 572 | #endif /* CONFIG_CODEC == SWCODEC */ |
574 | |||
575 | #ifndef __PCTOOL__ | ||
576 | #ifdef HAVE_TAGCACHE | ||
577 | #if CONFIG_CODEC == SWCODEC | ||
578 | |||
579 | enum { AUTORESUMABLE_UNKNOWN = 0, AUTORESUMABLE_TRUE, AUTORESUMABLE_FALSE }; | ||
580 | |||
581 | bool autoresumable(struct mp3entry *id3) | ||
582 | { | ||
583 | char *endp, *path; | ||
584 | size_t len; | ||
585 | bool is_resumable; | ||
586 | |||
587 | if (id3->autoresumable) /* result cached? */ | ||
588 | return id3->autoresumable == AUTORESUMABLE_TRUE; | ||
589 | |||
590 | is_resumable = false; | ||
591 | |||
592 | if (id3->path) | ||
593 | { | ||
594 | for (path = global_settings.autoresume_paths; | ||
595 | *path; /* search terms left? */ | ||
596 | path++) | ||
597 | { | ||
598 | if (*path == ':') /* Skip empty search patterns */ | ||
599 | continue; | ||
600 | |||
601 | /* FIXME: As soon as strcspn or strchrnul are made available in | ||
602 | the core, the following can be made more efficient. */ | ||
603 | endp = strchr(path, ':'); | ||
604 | if (endp) | ||
605 | len = endp - path; | ||
606 | else | ||
607 | len = strlen(path); | ||
608 | |||
609 | /* Note: At this point, len is always > 0 */ | ||
610 | |||
611 | if (strncasecmp(id3->path, path, len) == 0) | ||
612 | { | ||
613 | /* Full directory-name matches only. Trailing '/' in | ||
614 | search path OK. */ | ||
615 | if (id3->path[len] == '/' || id3->path[len - 1] == '/') | ||
616 | { | ||
617 | is_resumable = true; | ||
618 | break; | ||
619 | } | ||
620 | } | ||
621 | path += len - 1; | ||
622 | } | ||
623 | } | ||
624 | |||
625 | /* cache result */ | ||
626 | id3->autoresumable = | ||
627 | is_resumable ? AUTORESUMABLE_TRUE : AUTORESUMABLE_FALSE; | ||
628 | |||
629 | logf("autoresumable: %s is%s resumable", | ||
630 | id3->path, is_resumable ? "" : " not"); | ||
631 | |||
632 | return is_resumable; | ||
633 | } | ||
634 | |||
635 | #endif /* SWCODEC */ | ||
636 | #endif /* HAVE_TAGCACHE */ | ||
637 | #endif /* __PCTOOL__ */ | ||