diff options
Diffstat (limited to 'lib/rbcodec/metadata/metadata.c')
-rw-r--r-- | lib/rbcodec/metadata/metadata.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/lib/rbcodec/metadata/metadata.c b/lib/rbcodec/metadata/metadata.c index c24a27df2b..9c41347975 100644 --- a/lib/rbcodec/metadata/metadata.c +++ b/lib/rbcodec/metadata/metadata.c | |||
@@ -29,8 +29,6 @@ | |||
29 | 29 | ||
30 | #include "metadata_parsers.h" | 30 | #include "metadata_parsers.h" |
31 | 31 | ||
32 | #if CONFIG_CODEC == SWCODEC | ||
33 | |||
34 | /* For trailing tag stripping and base audio data types */ | 32 | /* For trailing tag stripping and base audio data types */ |
35 | #include "buffering.h" | 33 | #include "buffering.h" |
36 | 34 | ||
@@ -53,7 +51,6 @@ static bool get_other_asap_metadata(int fd, struct mp3entry *id3) | |||
53 | id3->genre_string = id3_get_num_genre(36); | 51 | id3->genre_string = id3_get_num_genre(36); |
54 | return true; | 52 | return true; |
55 | } | 53 | } |
56 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
57 | bool write_metadata_log = false; | 54 | bool write_metadata_log = false; |
58 | 55 | ||
59 | const struct afmt_entry audio_formats[AFMT_NUM_CODECS] = | 56 | const struct afmt_entry audio_formats[AFMT_NUM_CODECS] = |
@@ -66,13 +63,7 @@ const struct afmt_entry audio_formats[AFMT_NUM_CODECS] = | |||
66 | [AFMT_MPA_L2] = | 63 | [AFMT_MPA_L2] = |
67 | AFMT_ENTRY("MP2", "mpa", NULL, get_mp3_metadata, "mpa\0mp2\0"), | 64 | AFMT_ENTRY("MP2", "mpa", NULL, get_mp3_metadata, "mpa\0mp2\0"), |
68 | 65 | ||
69 | #if CONFIG_CODEC != SWCODEC | 66 | /* MPEG Audio layer 3 */ |
70 | /* MPEG Audio layer 3 on HWCODEC: .talk clips, no encoder */ | ||
71 | [AFMT_MPA_L3] = | ||
72 | AFMT_ENTRY("MP3", "mpa", NULL, get_mp3_metadata, "mp3\0talk\0"), | ||
73 | |||
74 | #else /* CONFIG_CODEC == SWCODEC */ | ||
75 | /* MPEG Audio layer 3 on SWCODEC */ | ||
76 | [AFMT_MPA_L3] = | 67 | [AFMT_MPA_L3] = |
77 | AFMT_ENTRY("MP3", "mpa", "mp3_enc", get_mp3_metadata, "mp3\0"), | 68 | AFMT_ENTRY("MP3", "mpa", "mp3_enc", get_mp3_metadata, "mp3\0"), |
78 | 69 | ||
@@ -238,10 +229,9 @@ const struct afmt_entry audio_formats[AFMT_NUM_CODECS] = | |||
238 | /* AAC bitstream format */ | 229 | /* AAC bitstream format */ |
239 | [AFMT_AAC_BSF] = | 230 | [AFMT_AAC_BSF] = |
240 | AFMT_ENTRY("AAC", "aac_bsf", NULL, get_aac_metadata, "aac\0"), | 231 | AFMT_ENTRY("AAC", "aac_bsf", NULL, get_aac_metadata, "aac\0"), |
241 | #endif | ||
242 | }; | 232 | }; |
243 | 233 | ||
244 | #if CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) | 234 | #if defined (HAVE_RECORDING) |
245 | /* get REC_FORMAT_* corresponding AFMT_* */ | 235 | /* get REC_FORMAT_* corresponding AFMT_* */ |
246 | const int rec_format_afmt[REC_NUM_FORMATS] = | 236 | const int rec_format_afmt[REC_NUM_FORMATS] = |
247 | { | 237 | { |
@@ -267,9 +257,8 @@ const int afmt_rec_format[AFMT_NUM_CODECS] = | |||
267 | [AFMT_PCM_WAV] = REC_FORMAT_PCM_WAV, | 257 | [AFMT_PCM_WAV] = REC_FORMAT_PCM_WAV, |
268 | }; | 258 | }; |
269 | #endif | 259 | #endif |
270 | #endif /* CONFIG_CODEC == SWCODEC && defined (HAVE_RECORDING) */ | 260 | #endif /* defined (HAVE_RECORDING) */ |
271 | 261 | ||
272 | #if CONFIG_CODEC == SWCODEC | ||
273 | /* Get the canonical AFMT type */ | 262 | /* Get the canonical AFMT type */ |
274 | int get_audio_base_codec_type(int type) | 263 | int get_audio_base_codec_type(int type) |
275 | { | 264 | { |
@@ -357,8 +346,6 @@ bool format_buffers_with_offset(int afmt) | |||
357 | return false; | 346 | return false; |
358 | } | 347 | } |
359 | } | 348 | } |
360 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
361 | |||
362 | 349 | ||
363 | /* Simple file type probing by looking at the filename extension. */ | 350 | /* Simple file type probing by looking at the filename extension. */ |
364 | unsigned int probe_file_format(const char *filename) | 351 | unsigned int probe_file_format(const char *filename) |
@@ -464,7 +451,6 @@ bool get_metadata(struct mp3entry* id3, int fd, const char* trackname) | |||
464 | } | 451 | } |
465 | 452 | ||
466 | #ifndef __PCTOOL__ | 453 | #ifndef __PCTOOL__ |
467 | #if CONFIG_CODEC == SWCODEC | ||
468 | void strip_tags(int handle_id) | 454 | void strip_tags(int handle_id) |
469 | { | 455 | { |
470 | static const unsigned char tag[] = "TAG"; | 456 | static const unsigned char tag[] = "TAG"; |
@@ -500,7 +486,6 @@ void strip_tags(int handle_id) | |||
500 | logf("Cutting off APE tag (%ldB)", len); | 486 | logf("Cutting off APE tag (%ldB)", len); |
501 | bufcuttail(handle_id, len); | 487 | bufcuttail(handle_id, len); |
502 | } | 488 | } |
503 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
504 | #endif /* ! __PCTOOL__ */ | 489 | #endif /* ! __PCTOOL__ */ |
505 | 490 | ||
506 | #define MOVE_ENTRY(x) if (x) x += offset; | 491 | #define MOVE_ENTRY(x) if (x) x += offset; |
@@ -544,7 +529,6 @@ void wipe_mp3entry(struct mp3entry *id3) | |||
544 | memset(id3, 0, sizeof (struct mp3entry)); | 529 | memset(id3, 0, sizeof (struct mp3entry)); |
545 | } | 530 | } |
546 | 531 | ||
547 | #if CONFIG_CODEC == SWCODEC | ||
548 | /* Glean what is possible from the filename alone - does not parse metadata */ | 532 | /* Glean what is possible from the filename alone - does not parse metadata */ |
549 | void fill_metadata_from_path(struct mp3entry *id3, const char *trackname) | 533 | void fill_metadata_from_path(struct mp3entry *id3, const char *trackname) |
550 | { | 534 | { |
@@ -574,4 +558,3 @@ void fill_metadata_from_path(struct mp3entry *id3, const char *trackname) | |||
574 | /* Copy the path info */ | 558 | /* Copy the path info */ |
575 | strlcpy(id3->path, trackname, sizeof (id3->path)); | 559 | strlcpy(id3->path, trackname, sizeof (id3->path)); |
576 | } | 560 | } |
577 | #endif /* CONFIG_CODEC == SWCODEC */ | ||