From a3541c07deb3d482ee17660cdf2644ad3499fc00 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Mon, 21 Jun 2010 18:45:34 +0000 Subject: Disable unneeded parts of mpc's file-I/O interface. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27024 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libmusepack/reader.h | 2 ++ apps/codecs/mpc.c | 21 ++++----------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/apps/codecs/libmusepack/reader.h b/apps/codecs/libmusepack/reader.h index 60a0ef939d..c46844cd59 100644 --- a/apps/codecs/libmusepack/reader.h +++ b/apps/codecs/libmusepack/reader.h @@ -65,12 +65,14 @@ struct mpc_reader_t { /// Returns the total length of the source stream, in bytes. mpc_int32_t (*get_size)(mpc_reader *p_reader); + /* rockbox: not used /// True if the stream is a seekable stream. mpc_bool_t (*canseek)(mpc_reader *p_reader); /// Field that can be used to identify a particular instance of /// reader or carry along data associated with that reader. void *data; + */ }; /* rockbox: not used /// Initializes reader with default stdio file reader implementation. Use diff --git a/apps/codecs/mpc.c b/apps/codecs/mpc.c index afda2871f9..5a00e449a9 100644 --- a/apps/codecs/mpc.c +++ b/apps/codecs/mpc.c @@ -30,39 +30,28 @@ MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH] IBSS_ATTR; /* Our implementations of the mpc_reader callback functions. */ static mpc_int32_t read_impl(mpc_reader *reader, void *ptr, mpc_int32_t size) { - struct codec_api *ci = (struct codec_api *)(reader->data); + (void)reader; return ((mpc_int32_t)(ci->read_filebuf(ptr, size))); } static mpc_bool_t seek_impl(mpc_reader *reader, mpc_int32_t offset) { - struct codec_api *ci = (struct codec_api *)(reader->data); - /* WARNING: assumes we don't need to skip too far into the past, this might not be supported by the buffering layer yet */ + (void)reader; return ci->seek_buffer(offset); } static mpc_int32_t tell_impl(mpc_reader *reader) { - struct codec_api *ci = (struct codec_api *)(reader->data); - + (void)reader; return ci->curpos; } static mpc_int32_t get_size_impl(mpc_reader *reader) -{ - struct codec_api *ci = (struct codec_api *)(reader->data); - - return ci->filesize; -} - -static mpc_bool_t canseek_impl(mpc_reader *reader) { (void)reader; - - /* doesn't much matter, libmusepack ignores this anyway */ - return true; + return ci->filesize; } /* this is the codec entry point */ @@ -90,8 +79,6 @@ enum codec_status codec_main(void) reader.seek = seek_impl; reader.tell = tell_impl; reader.get_size = get_size_impl; - reader.canseek = canseek_impl; - reader.data = ci; next_track: if (codec_init()) -- cgit v1.2.3