diff options
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/buffering.c | 6 | ||||
| -rw-r--r-- | apps/buffering.h | 1 | ||||
| -rw-r--r-- | apps/playback.c | 15 |
3 files changed, 17 insertions, 5 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index 9c0ad13..1482d67 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -1012,7 +1012,11 @@ int bufopen(const char *file, size_t offset, enum data_type type, return h->id; } - +#ifdef APPLICATION + /* loading code from memory is not supported in application builds */ + else if (type == TYPE_CODEC) + return ERR_UNSUPPORTED_TYPE; +#endif /* Other cases: there is a little more work. */ int fd = open(file, O_RDONLY); if (fd < 0) diff --git a/apps/buffering.h b/apps/buffering.h index 6e17b65..c3a9f92 100644 --- a/apps/buffering.h +++ b/apps/buffering.h @@ -44,6 +44,7 @@ enum data_type { #define ERR_INVALID_VALUE -3 #define ERR_FILE_ERROR -4 #define ERR_HANDLE_NOT_DONE -5 +#define ERR_UNSUPPORTED_TYPE -6 /* Initialise the buffering subsystem */ diff --git a/apps/playback.c b/apps/playback.c index 9030161..3a7faa3 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1066,7 +1066,7 @@ static bool audio_release_tracks(void) static bool audio_loadcodec(bool start_play) { - int prev_track; + int prev_track, hid; char codec_path[MAX_PATH]; /* Full path to codec */ const struct mp3entry *id3, *prev_id3; @@ -1121,11 +1121,18 @@ static bool audio_loadcodec(bool start_play) codec_get_full_path(codec_path, codec_fn); - tracks[track_widx].codec_hid = bufopen(codec_path, 0, TYPE_CODEC, NULL); - if (tracks[track_widx].codec_hid < 0) + hid = tracks[track_widx].codec_hid = bufopen(codec_path, 0, TYPE_CODEC, NULL); + + /* not an error if codec load it supported, will load it from disk + * application builds don't support it + */ + if (hid < 0 && hid != ERR_UNSUPPORTED_TYPE) return false; - logf("Loaded codec"); + if (hid > 0) + logf("Loaded codec"); + else + logf("Buffering codec unsupported, load later from disk"); return true; } |