aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-17 17:53:59 +0200
committerMax Kellermann <max@duempel.org>2008-10-17 17:53:59 +0200
commit4984639b7255d72e272f278c95adb1a2cf71b61c (patch)
tree4751fbdef706d62b77d41c411462fbf6f852f384 /src
parentb73ecbb073625b56aaef33f2fa7f102fdc9a6247 (diff)
downloadmpd-4984639b7255d72e272f278c95adb1a2cf71b61c.tar.gz
mpd-4984639b7255d72e272f278c95adb1a2cf71b61c.tar.xz
mpd-4984639b7255d72e272f278c95adb1a2cf71b61c.zip
input_stream: removed nmemb argument
The nmemb argument isn't actually useful, and one of nmemb and size was always passed as 1. Remove it.
Diffstat (limited to 'src')
-rw-r--r--src/decoder_api.c2
-rw-r--r--src/inputPlugins/mp4_plugin.c2
-rw-r--r--src/inputStream.c4
-rw-r--r--src/inputStream.h4
-rw-r--r--src/inputStream_file.c5
-rw-r--r--src/inputStream_file.h3
-rw-r--r--src/inputStream_http.c5
-rw-r--r--src/inputStream_http.h3
8 files changed, 12 insertions, 16 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 933ee7106..8175fbac8 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -115,7 +115,7 @@ size_t decoder_read(struct decoder *decoder,
dc.command != DECODE_COMMAND_NONE)
return 0;
- nbytes = readFromInputStream(inStream, buffer, 1, length);
+ nbytes = readFromInputStream(inStream, buffer, length);
if (nbytes > 0 || inputStreamAtEOF(inStream))
return nbytes;
diff --git a/src/inputPlugins/mp4_plugin.c b/src/inputPlugins/mp4_plugin.c
index d284313d4..0e152c3a6 100644
--- a/src/inputPlugins/mp4_plugin.c
+++ b/src/inputPlugins/mp4_plugin.c
@@ -71,7 +71,7 @@ static int mp4_getAACTrack(mp4ff_t * infile)
static uint32_t mp4_inputStreamReadCallback(void *inStream, void *buffer,
uint32_t length)
{
- return readFromInputStream((InputStream *) inStream, buffer, 1, length);
+ return readFromInputStream((InputStream *) inStream, buffer, length);
}
static uint32_t mp4_inputStreamSeekCallback(void *inStream, uint64_t position)
diff --git a/src/inputStream.c b/src/inputStream.c
index 5805018f2..c82a16b2e 100644
--- a/src/inputStream.c
+++ b/src/inputStream.c
@@ -54,9 +54,9 @@ int seekInputStream(struct input_stream *inStream, long offset, int whence)
}
size_t readFromInputStream(struct input_stream *inStream,
- void *ptr, size_t size, size_t nmemb)
+ void *ptr, size_t size)
{
- return inStream->readFunc(inStream, ptr, size, nmemb);
+ return inStream->readFunc(inStream, ptr, size);
}
int closeInputStream(struct input_stream *inStream)
diff --git a/src/inputStream.h b/src/inputStream.h
index 31216ef2c..3637ac150 100644
--- a/src/inputStream.h
+++ b/src/inputStream.h
@@ -26,7 +26,7 @@ typedef struct input_stream InputStream;
typedef int (*InputStreamSeekFunc) (struct input_stream *inStream, long offset,
int whence);
typedef size_t(*InputStreamReadFunc) (struct input_stream *inStream, void *ptr,
- size_t size, size_t nmemb);
+ size_t size);
typedef int (*InputStreamCloseFunc) (struct input_stream *inStream);
typedef int (*InputStreamAtEOFFunc) (struct input_stream *inStream);
typedef int (*InputStreamBufferFunc) (struct input_stream *inStream);
@@ -67,6 +67,6 @@ int inputStreamAtEOF(struct input_stream *inStream);
int bufferInputStream(struct input_stream *inStream);
size_t readFromInputStream(struct input_stream *inStream,
- void *ptr, size_t size, size_t nmemb);
+ void *ptr, size_t size);
#endif
diff --git a/src/inputStream_file.c b/src/inputStream_file.c
index eea1d11aa..9b5a1a62d 100644
--- a/src/inputStream_file.c
+++ b/src/inputStream_file.c
@@ -71,12 +71,11 @@ int inputStream_fileSeek(struct input_stream *inStream, long offset,
}
size_t inputStream_fileRead(struct input_stream *inStream,
- void *ptr, size_t size,
- size_t nmemb)
+ void *ptr, size_t size)
{
size_t readSize;
- readSize = fread(ptr, size, nmemb, (FILE *) inStream->data);
+ readSize = fread(ptr, 1, size, (FILE *) inStream->data);
if (readSize <= 0 && ferror((FILE *) inStream->data)) {
inStream->error = errno;
DEBUG("inputStream_fileRead: error reading: %s\n",
diff --git a/src/inputStream_file.h b/src/inputStream_file.h
index c0f56be04..9199d9c01 100644
--- a/src/inputStream_file.h
+++ b/src/inputStream_file.h
@@ -29,8 +29,7 @@ int inputStream_fileSeek(struct input_stream *inStream, long offset,
int whence);
size_t inputStream_fileRead(struct input_stream *inStream,
- void *ptr, size_t size,
- size_t nmemb);
+ void *ptr, size_t size);
int inputStream_fileClose(struct input_stream *inStream);
diff --git a/src/inputStream_http.c b/src/inputStream_http.c
index ace6da4ce..bbde11825 100644
--- a/src/inputStream_http.c
+++ b/src/inputStream_http.c
@@ -890,11 +890,10 @@ static size_t read_with_metadata(InputStream *is, unsigned char *ptr,
return readed;
}
-size_t inputStream_httpRead(InputStream * is, void *_ptr, size_t size,
- size_t nmemb)
+size_t inputStream_httpRead(InputStream * is, void *_ptr, size_t size)
{
struct http_data *data = (struct http_data *) is->data;
- size_t len = size * nmemb;
+ size_t len = size;
size_t r;
unsigned char *ptr = _ptr, *ptr0 = _ptr;
long tries = len / 128; /* try harder for bigger reads */
diff --git a/src/inputStream_http.h b/src/inputStream_http.h
index 7ab23a5de..01d70c1eb 100644
--- a/src/inputStream_http.h
+++ b/src/inputStream_http.h
@@ -27,8 +27,7 @@ int inputStream_httpOpen(InputStream * inStream, char *filename);
int inputStream_httpSeek(InputStream * inStream, long offset, int whence);
-size_t inputStream_httpRead(InputStream * inStream, void *ptr, size_t size,
- size_t nmemb);
+size_t inputStream_httpRead(InputStream * inStream, void *ptr, size_t size);
int inputStream_httpClose(InputStream * inStream);