Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4984639b
Commit
4984639b
authored
Oct 17, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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.
parent
b73ecbb0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
16 deletions
+12
-16
decoder_api.c
src/decoder_api.c
+1
-1
mp4_plugin.c
src/inputPlugins/mp4_plugin.c
+1
-1
inputStream.c
src/inputStream.c
+2
-2
inputStream.h
src/inputStream.h
+2
-2
inputStream_file.c
src/inputStream_file.c
+2
-3
inputStream_file.h
src/inputStream_file.h
+1
-2
inputStream_http.c
src/inputStream_http.c
+2
-3
inputStream_http.h
src/inputStream_http.h
+1
-2
No files found.
src/decoder_api.c
View file @
4984639b
...
@@ -115,7 +115,7 @@ size_t decoder_read(struct decoder *decoder,
...
@@ -115,7 +115,7 @@ size_t decoder_read(struct decoder *decoder,
dc
.
command
!=
DECODE_COMMAND_NONE
)
dc
.
command
!=
DECODE_COMMAND_NONE
)
return
0
;
return
0
;
nbytes
=
readFromInputStream
(
inStream
,
buffer
,
1
,
length
);
nbytes
=
readFromInputStream
(
inStream
,
buffer
,
length
);
if
(
nbytes
>
0
||
inputStreamAtEOF
(
inStream
))
if
(
nbytes
>
0
||
inputStreamAtEOF
(
inStream
))
return
nbytes
;
return
nbytes
;
...
...
src/inputPlugins/mp4_plugin.c
View file @
4984639b
...
@@ -71,7 +71,7 @@ static int mp4_getAACTrack(mp4ff_t * infile)
...
@@ -71,7 +71,7 @@ static int mp4_getAACTrack(mp4ff_t * infile)
static
uint32_t
mp4_inputStreamReadCallback
(
void
*
inStream
,
void
*
buffer
,
static
uint32_t
mp4_inputStreamReadCallback
(
void
*
inStream
,
void
*
buffer
,
uint32_t
length
)
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
)
static
uint32_t
mp4_inputStreamSeekCallback
(
void
*
inStream
,
uint64_t
position
)
...
...
src/inputStream.c
View file @
4984639b
...
@@ -54,9 +54,9 @@ int seekInputStream(struct input_stream *inStream, long offset, int whence)
...
@@ -54,9 +54,9 @@ int seekInputStream(struct input_stream *inStream, long offset, int whence)
}
}
size_t
readFromInputStream
(
struct
input_stream
*
inStream
,
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
)
int
closeInputStream
(
struct
input_stream
*
inStream
)
...
...
src/inputStream.h
View file @
4984639b
...
@@ -26,7 +26,7 @@ typedef struct input_stream InputStream;
...
@@ -26,7 +26,7 @@ typedef struct input_stream InputStream;
typedef
int
(
*
InputStreamSeekFunc
)
(
struct
input_stream
*
inStream
,
long
offset
,
typedef
int
(
*
InputStreamSeekFunc
)
(
struct
input_stream
*
inStream
,
long
offset
,
int
whence
);
int
whence
);
typedef
size_t
(
*
InputStreamReadFunc
)
(
struct
input_stream
*
inStream
,
void
*
ptr
,
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
(
*
InputStreamCloseFunc
)
(
struct
input_stream
*
inStream
);
typedef
int
(
*
InputStreamAtEOFFunc
)
(
struct
input_stream
*
inStream
);
typedef
int
(
*
InputStreamAtEOFFunc
)
(
struct
input_stream
*
inStream
);
typedef
int
(
*
InputStreamBufferFunc
)
(
struct
input_stream
*
inStream
);
typedef
int
(
*
InputStreamBufferFunc
)
(
struct
input_stream
*
inStream
);
...
@@ -67,6 +67,6 @@ int inputStreamAtEOF(struct input_stream *inStream);
...
@@ -67,6 +67,6 @@ int inputStreamAtEOF(struct input_stream *inStream);
int
bufferInputStream
(
struct
input_stream
*
inStream
);
int
bufferInputStream
(
struct
input_stream
*
inStream
);
size_t
readFromInputStream
(
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
#endif
src/inputStream_file.c
View file @
4984639b
...
@@ -71,12 +71,11 @@ int inputStream_fileSeek(struct input_stream *inStream, long offset,
...
@@ -71,12 +71,11 @@ int inputStream_fileSeek(struct input_stream *inStream, long offset,
}
}
size_t
inputStream_fileRead
(
struct
input_stream
*
inStream
,
size_t
inputStream_fileRead
(
struct
input_stream
*
inStream
,
void
*
ptr
,
size_t
size
,
void
*
ptr
,
size_t
size
)
size_t
nmemb
)
{
{
size_t
readSize
;
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
))
{
if
(
readSize
<=
0
&&
ferror
((
FILE
*
)
inStream
->
data
))
{
inStream
->
error
=
errno
;
inStream
->
error
=
errno
;
DEBUG
(
"inputStream_fileRead: error reading: %s
\n
"
,
DEBUG
(
"inputStream_fileRead: error reading: %s
\n
"
,
...
...
src/inputStream_file.h
View file @
4984639b
...
@@ -29,8 +29,7 @@ int inputStream_fileSeek(struct input_stream *inStream, long offset,
...
@@ -29,8 +29,7 @@ int inputStream_fileSeek(struct input_stream *inStream, long offset,
int
whence
);
int
whence
);
size_t
inputStream_fileRead
(
struct
input_stream
*
inStream
,
size_t
inputStream_fileRead
(
struct
input_stream
*
inStream
,
void
*
ptr
,
size_t
size
,
void
*
ptr
,
size_t
size
);
size_t
nmemb
);
int
inputStream_fileClose
(
struct
input_stream
*
inStream
);
int
inputStream_fileClose
(
struct
input_stream
*
inStream
);
...
...
src/inputStream_http.c
View file @
4984639b
...
@@ -890,11 +890,10 @@ static size_t read_with_metadata(InputStream *is, unsigned char *ptr,
...
@@ -890,11 +890,10 @@ static size_t read_with_metadata(InputStream *is, unsigned char *ptr,
return
readed
;
return
readed
;
}
}
size_t
inputStream_httpRead
(
InputStream
*
is
,
void
*
_ptr
,
size_t
size
,
size_t
inputStream_httpRead
(
InputStream
*
is
,
void
*
_ptr
,
size_t
size
)
size_t
nmemb
)
{
{
struct
http_data
*
data
=
(
struct
http_data
*
)
is
->
data
;
struct
http_data
*
data
=
(
struct
http_data
*
)
is
->
data
;
size_t
len
=
size
*
nmemb
;
size_t
len
=
size
;
size_t
r
;
size_t
r
;
unsigned
char
*
ptr
=
_ptr
,
*
ptr0
=
_ptr
;
unsigned
char
*
ptr
=
_ptr
,
*
ptr0
=
_ptr
;
long
tries
=
len
/
128
;
/* try harder for bigger reads */
long
tries
=
len
/
128
;
/* try harder for bigger reads */
...
...
src/inputStream_http.h
View file @
4984639b
...
@@ -27,8 +27,7 @@ int inputStream_httpOpen(InputStream * inStream, char *filename);
...
@@ -27,8 +27,7 @@ int inputStream_httpOpen(InputStream * inStream, char *filename);
int
inputStream_httpSeek
(
InputStream
*
inStream
,
long
offset
,
int
whence
);
int
inputStream_httpSeek
(
InputStream
*
inStream
,
long
offset
,
int
whence
);
size_t
inputStream_httpRead
(
InputStream
*
inStream
,
void
*
ptr
,
size_t
size
,
size_t
inputStream_httpRead
(
InputStream
*
inStream
,
void
*
ptr
,
size_t
size
);
size_t
nmemb
);
int
inputStream_httpClose
(
InputStream
*
inStream
);
int
inputStream_httpClose
(
InputStream
*
inStream
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment