diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-06-21 18:45:34 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-06-21 18:45:34 +0000 |
commit | a3541c07deb3d482ee17660cdf2644ad3499fc00 (patch) | |
tree | bf22f09f5fc6031e624e464a96efe057abc7448e /apps | |
parent | d18aa51ded253229e470d4e4a2d6df31bbae0bdf (diff) | |
download | rockbox-a3541c07deb3d482ee17660cdf2644ad3499fc00.tar.gz rockbox-a3541c07deb3d482ee17660cdf2644ad3499fc00.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codecs/libmusepack/reader.h | 2 | ||||
-rw-r--r-- | 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 { | |||
65 | /// Returns the total length of the source stream, in bytes. | 65 | /// Returns the total length of the source stream, in bytes. |
66 | mpc_int32_t (*get_size)(mpc_reader *p_reader); | 66 | mpc_int32_t (*get_size)(mpc_reader *p_reader); |
67 | 67 | ||
68 | /* rockbox: not used | ||
68 | /// True if the stream is a seekable stream. | 69 | /// True if the stream is a seekable stream. |
69 | mpc_bool_t (*canseek)(mpc_reader *p_reader); | 70 | mpc_bool_t (*canseek)(mpc_reader *p_reader); |
70 | 71 | ||
71 | /// Field that can be used to identify a particular instance of | 72 | /// Field that can be used to identify a particular instance of |
72 | /// reader or carry along data associated with that reader. | 73 | /// reader or carry along data associated with that reader. |
73 | void *data; | 74 | void *data; |
75 | */ | ||
74 | }; | 76 | }; |
75 | /* rockbox: not used | 77 | /* rockbox: not used |
76 | /// Initializes reader with default stdio file reader implementation. Use | 78 | /// 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; | |||
30 | /* Our implementations of the mpc_reader callback functions. */ | 30 | /* Our implementations of the mpc_reader callback functions. */ |
31 | static mpc_int32_t read_impl(mpc_reader *reader, void *ptr, mpc_int32_t size) | 31 | static mpc_int32_t read_impl(mpc_reader *reader, void *ptr, mpc_int32_t size) |
32 | { | 32 | { |
33 | struct codec_api *ci = (struct codec_api *)(reader->data); | 33 | (void)reader; |
34 | return ((mpc_int32_t)(ci->read_filebuf(ptr, size))); | 34 | return ((mpc_int32_t)(ci->read_filebuf(ptr, size))); |
35 | } | 35 | } |
36 | 36 | ||
37 | static mpc_bool_t seek_impl(mpc_reader *reader, mpc_int32_t offset) | 37 | static mpc_bool_t seek_impl(mpc_reader *reader, mpc_int32_t offset) |
38 | { | 38 | { |
39 | struct codec_api *ci = (struct codec_api *)(reader->data); | ||
40 | |||
41 | /* WARNING: assumes we don't need to skip too far into the past, | 39 | /* WARNING: assumes we don't need to skip too far into the past, |
42 | this might not be supported by the buffering layer yet */ | 40 | this might not be supported by the buffering layer yet */ |
41 | (void)reader; | ||
43 | return ci->seek_buffer(offset); | 42 | return ci->seek_buffer(offset); |
44 | } | 43 | } |
45 | 44 | ||
46 | static mpc_int32_t tell_impl(mpc_reader *reader) | 45 | static mpc_int32_t tell_impl(mpc_reader *reader) |
47 | { | 46 | { |
48 | struct codec_api *ci = (struct codec_api *)(reader->data); | 47 | (void)reader; |
49 | |||
50 | return ci->curpos; | 48 | return ci->curpos; |
51 | } | 49 | } |
52 | 50 | ||
53 | static mpc_int32_t get_size_impl(mpc_reader *reader) | 51 | static mpc_int32_t get_size_impl(mpc_reader *reader) |
54 | { | 52 | { |
55 | struct codec_api *ci = (struct codec_api *)(reader->data); | ||
56 | |||
57 | return ci->filesize; | ||
58 | } | ||
59 | |||
60 | static mpc_bool_t canseek_impl(mpc_reader *reader) | ||
61 | { | ||
62 | (void)reader; | 53 | (void)reader; |
63 | 54 | return ci->filesize; | |
64 | /* doesn't much matter, libmusepack ignores this anyway */ | ||
65 | return true; | ||
66 | } | 55 | } |
67 | 56 | ||
68 | /* this is the codec entry point */ | 57 | /* this is the codec entry point */ |
@@ -90,8 +79,6 @@ enum codec_status codec_main(void) | |||
90 | reader.seek = seek_impl; | 79 | reader.seek = seek_impl; |
91 | reader.tell = tell_impl; | 80 | reader.tell = tell_impl; |
92 | reader.get_size = get_size_impl; | 81 | reader.get_size = get_size_impl; |
93 | reader.canseek = canseek_impl; | ||
94 | reader.data = ci; | ||
95 | 82 | ||
96 | next_track: | 83 | next_track: |
97 | if (codec_init()) | 84 | if (codec_init()) |