0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

stream: kill memory streams

These are unused by now, and it relied on some assumptions that have
been broken by now.
This commit is contained in:
wm4 2013-05-24 17:47:01 +02:00
parent 3face4300e
commit 3d6b4ea4b6
2 changed files with 3 additions and 23 deletions

View File

@ -137,6 +137,8 @@ static const stream_info_t *const auto_open_streams[] = {
NULL
};
static stream_t *new_stream(int fd, int type);
static stream_t *open_stream_plugin(const stream_info_t *sinfo,
const char *filename,
int mode, struct MPOpts *options,
@ -626,26 +628,7 @@ void stream_update_size(stream_t *s)
}
}
stream_t *new_memory_stream(unsigned char *data, int len)
{
stream_t *s;
if (len < 0)
return NULL;
s = calloc(1, sizeof(stream_t) + len);
s->fd = -1;
s->type = STREAMTYPE_MEMORY;
s->buf_pos = 0;
s->buf_len = len;
s->start_pos = 0;
s->end_pos = len;
stream_reset(s);
s->pos = len;
memcpy(s->buffer, data, len);
return s;
}
stream_t *new_stream(int fd, int type)
static stream_t *new_stream(int fd, int type)
{
stream_t *s = talloc_zero(NULL, stream_t);

View File

@ -40,7 +40,6 @@
#define STREAMTYPE_VCD 1 // raw mode-2 CDROM reading, 2324 bytes/sector
#define STREAMTYPE_STREAM 2 // same as FILE but no seeking (for net/stdin)
#define STREAMTYPE_DVD 3 // libdvdread
#define STREAMTYPE_MEMORY 4 // read data from memory area
#define STREAMTYPE_PLAYLIST 6 // FIXME!!! same as STREAMTYPE_FILE now
#define STREAMTYPE_CDDA 10 // raw audio CD reader
#define STREAMTYPE_SMB 11 // smb:// url, using libsmbclient (samba)
@ -328,9 +327,7 @@ struct bstr stream_read_complete(struct stream *s, void *talloc_ctx,
void stream_reset(stream_t *s);
int stream_control(stream_t *s, int cmd, void *arg);
void stream_update_size(stream_t *s);
stream_t *new_stream(int fd, int type);
void free_stream(stream_t *s);
stream_t *new_memory_stream(unsigned char *data, int len);
stream_t *open_stream(const char *filename, struct MPOpts *options,
int *file_format);
stream_t *open_output_stream(const char *filename, struct MPOpts *options);