diff options
-rw-r--r-- | apps/gui/gwps-common.c | 11 | ||||
-rw-r--r-- | firmware/export/id3.h | 1 | ||||
-rw-r--r-- | firmware/id3.c | 17 |
3 files changed, 14 insertions, 15 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 2e0afab1ee..8fc1f36484 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -698,6 +698,15 @@ static void draw_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size) | |||
698 | 698 | ||
699 | #endif /* HAVE_LCD_CHARCELL */ | 699 | #endif /* HAVE_LCD_CHARCELL */ |
700 | 700 | ||
701 | static char* get_codectype(const struct mp3entry* id3) | ||
702 | { | ||
703 | if (id3->codectype < AFMT_NUM_CODECS) { | ||
704 | return (char*)audio_formats[id3->codectype].label; | ||
705 | } else { | ||
706 | return NULL; | ||
707 | } | ||
708 | } | ||
709 | |||
701 | /* Extract a part from a path. | 710 | /* Extract a part from a path. |
702 | * | 711 | * |
703 | * buf - buffer extract part to. | 712 | * buf - buffer extract part to. |
@@ -983,7 +992,7 @@ static char *get_token_value(struct gui_wps *gwps, | |||
983 | else | 992 | else |
984 | *intval = id3->codectype; | 993 | *intval = id3->codectype; |
985 | } | 994 | } |
986 | return id3_get_codec(id3); | 995 | return get_codectype(id3); |
987 | 996 | ||
988 | case WPS_TOKEN_FILE_FREQUENCY: | 997 | case WPS_TOKEN_FILE_FREQUENCY: |
989 | snprintf(buf, buf_size, "%ld", id3->frequency); | 998 | snprintf(buf, buf_size, "%ld", id3->frequency); |
diff --git a/firmware/export/id3.h b/firmware/export/id3.h index 8b2d02ea30..8aaf76f73c 100644 --- a/firmware/export/id3.h +++ b/firmware/export/id3.h | |||
@@ -232,7 +232,6 @@ enum { | |||
232 | bool get_mp3_metadata(int fd, struct mp3entry *entry, const char *filename); | 232 | bool get_mp3_metadata(int fd, struct mp3entry *entry, const char *filename); |
233 | bool mp3info(struct mp3entry *entry, const char *filename); | 233 | bool mp3info(struct mp3entry *entry, const char *filename); |
234 | char* id3_get_num_genre(unsigned int genre_num); | 234 | char* id3_get_num_genre(unsigned int genre_num); |
235 | char* id3_get_codec(const struct mp3entry* id3); | ||
236 | int getid3v2len(int fd); | 235 | int getid3v2len(int fd); |
237 | void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig); | 236 | void adjust_mp3entry(struct mp3entry *entry, void *dest, const void *orig); |
238 | void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig); | 237 | void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig); |
diff --git a/firmware/id3.c b/firmware/id3.c index d63acbb8aa..181ce97c6c 100644 --- a/firmware/id3.c +++ b/firmware/id3.c | |||
@@ -143,10 +143,10 @@ const int afmt_rec_format[AFMT_NUM_CODECS] = | |||
143 | #endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ | 143 | #endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ |
144 | /****/ | 144 | /****/ |
145 | 145 | ||
146 | unsigned long unsync(unsigned long b0, | 146 | static unsigned long unsync(unsigned long b0, |
147 | unsigned long b1, | 147 | unsigned long b1, |
148 | unsigned long b2, | 148 | unsigned long b2, |
149 | unsigned long b3) | 149 | unsigned long b3) |
150 | { | 150 | { |
151 | return (((long)(b0 & 0x7F) << (3*7)) | | 151 | return (((long)(b0 & 0x7F) << (3*7)) | |
152 | ((long)(b1 & 0x7F) << (2*7)) | | 152 | ((long)(b1 & 0x7F) << (2*7)) | |
@@ -199,15 +199,6 @@ static bool id3_is_genre_string(const char *string) | |||
199 | string <= genres[sizeof(genres)/sizeof(char*) - 1] ); | 199 | string <= genres[sizeof(genres)/sizeof(char*) - 1] ); |
200 | } | 200 | } |
201 | 201 | ||
202 | char* id3_get_codec(const struct mp3entry* id3) | ||
203 | { | ||
204 | if (id3->codectype < AFMT_NUM_CODECS) { | ||
205 | return (char*)audio_formats[id3->codectype].label; | ||
206 | } else { | ||
207 | return NULL; | ||
208 | } | ||
209 | } | ||
210 | |||
211 | /* | 202 | /* |
212 | HOW TO ADD ADDITIONAL ID3 VERSION 2 TAGS | 203 | HOW TO ADD ADDITIONAL ID3 VERSION 2 TAGS |
213 | Code and comments by Thomas Paul Diffenbach | 204 | Code and comments by Thomas Paul Diffenbach |