Mercurial > audlegacy-plugins
changeset 499:ef7ceb6b183c trunk
[svn] - labotomize the ffmpeg I/O code, making it an over-engineered VFS
wrapper (ouch!)
author | nenolod |
---|---|
date | Sun, 21 Jan 2007 20:25:59 -0800 |
parents | 6779a84fbf10 |
children | 1d81ea250dce |
files | ChangeLog src/wma/libffwma/allformats.c src/wma/libffwma/avio.c src/wma/libffwma/file.c |
diffstat | 4 files changed, 9 insertions(+), 108 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sun Jan 21 20:09:18 2007 -0800 +++ b/ChangeLog Sun Jan 21 20:25:59 2007 -0800 @@ -1,3 +1,12 @@ +2007-01-22 04:09:18 +0000 William Pitcock <nenolod@sacredspiral.co.uk> + revision [1082] + - ignore CURLE_PARTIAL_FILE, as this can happen in some cases and is + described as normal in the curl documentation. + + trunk/src/curl/curl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + + 2007-01-22 03:55:50 +0000 William Pitcock <nenolod@sacredspiral.co.uk> revision [1080] - decrement handle->rd_abs when we do an ungetc.
--- a/src/wma/libffwma/allformats.c Sun Jan 21 20:09:18 2007 -0800 +++ b/src/wma/libffwma/allformats.c Sun Jan 21 20:25:59 2007 -0800 @@ -27,9 +27,4 @@ /* file protocols */ register_protocol(&file_protocol); - register_protocol(&pipe_protocol); - -#if 1 - register_protocol(&mms_protocol); -#endif }
--- a/src/wma/libffwma/avio.c Sun Jan 21 20:09:18 2007 -0800 +++ b/src/wma/libffwma/avio.c Sun Jan 21 20:25:59 2007 -0800 @@ -42,33 +42,7 @@ char proto_str[128], *q; int err; - p = filename; - q = proto_str; - while (*p != '\0' && *p != ':') { - /* protocols can only contain alphabetic chars */ - if (!isalpha((int) *p)) - goto file_proto; - if ((size_t)(q - proto_str) < sizeof(proto_str) - 1) - *q++ = *p; - p++; - } - /* if the protocol has length 1, we consider it is a dos drive */ - if (*p == '\0' || (q - proto_str) <= 1) { - file_proto: - strcpy(proto_str, "file"); - } else { - *q = '\0'; - } - up = first_protocol; - while (up != NULL) { - if (!strcmp(proto_str, up->name)) - goto found; - up = up->next; - } - err = -ENOENT; - goto fail; - found: uc = av_malloc(sizeof(URLContext) + strlen(filename)); if (!uc) { err = -ENOMEM;
--- a/src/wma/libffwma/file.c Sun Jan 21 20:09:18 2007 -0800 +++ b/src/wma/libffwma/file.c Sun Jan 21 20:25:59 2007 -0800 @@ -90,80 +90,3 @@ NULL }; -/* pipe protocol */ - -static int pipe_open(URLContext *h, const char *filename, int flags) -{ - int fd; - - if (flags & URL_WRONLY) { - fd = 1; - } else { - fd = 0; - } - h->priv_data = (void *)(long)fd; - return 0; -} - -static int pipe_read(URLContext *h, unsigned char *buf, int size) -{ - int fd = (int)(long)h->priv_data; - return read(fd, buf, size); -} - -static int pipe_write(URLContext *h, unsigned char *buf, int size) -{ - int fd = (int)(long)h->priv_data; - return write(fd, buf, size); -} - -static int pipe_close(URLContext *h) -{ - return 0; -} - -URLProtocol pipe_protocol = { - "pipe", - pipe_open, - pipe_read, - pipe_write, - NULL, - pipe_close, - NULL -}; - -/* new mms protocol stuff --nenolod */ - -static int _mms_open(URLContext *h, const char *filename, int flags) -{ - mms_t *mms = mms_connect(NULL, NULL, filename, 1); - - if (mms == NULL) - return -ENOENT; - - h->priv_data = (void *)mms; - return 0; -} - -static int _mms_read(URLContext *h, unsigned char *buf, int size) -{ - mms_t *mms = (mms_t *) h->priv_data; - return mms_read(NULL, mms, (char*)buf, size); -} - -static int _mms_close(URLContext *h) -{ - mms_t *mms = (mms_t *) h->priv_data; - mms_close(mms); - return 0; -} - -URLProtocol mms_protocol = { - "mms", - _mms_open, - _mms_read, - NULL, - NULL, - _mms_close, - NULL -};