diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-04 13:01:54 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-04 13:01:54 +0100 |
commit | e1cf1a9c89dbb3b867c50421cf543221a4d223f9 (patch) | |
tree | acbed33573df63b7d86f785bb44d875326f59420 /libavformat | |
parent | d0b450457b3aeb8c234b0b0a987db55d3485326b (diff) | |
parent | a0b7e289075dccf223b7f407790d8a86fc5d77e8 (diff) | |
download | ffmpeg-e1cf1a9c89dbb3b867c50421cf543221a4d223f9.tar.gz |
Merge commit 'a0b7e289075dccf223b7f407790d8a86fc5d77e8'
* commit 'a0b7e289075dccf223b7f407790d8a86fc5d77e8':
aviobuf: Partial support for reading in read/write contexts
build: Avoid detecting bogus components named 'x'
Conflicts:
libavcodec/allcodecs.c
libavdevice/alldevices.c
libavformat/allformats.c
libavformat/aviobuf.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/allformats.c | 3 | ||||
-rw-r--r-- | libavformat/aviobuf.c | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 3946609bb9..c3aa187f5b 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -39,8 +39,7 @@ av_register_input_format(&ff_##x##_demuxer); \ } -/* Warning: do not split this line, it will break configure script */ -#define REGISTER_MUXDEMUX(X, x) REGISTER_MUXER(X, x); REGISTER_DEMUXER(X,x) +#define REGISTER_MUXDEMUX(X, x) REGISTER_MUXER(X, x); REGISTER_DEMUXER(X, x) #define REGISTER_PROTOCOL(X, x) \ { \ diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 6733b59dab..95a41bbbc6 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -483,7 +483,7 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size) len = s->buf_end - s->buf_ptr; if (len > size) len = size; - if (len == 0) { + if (len == 0 || s->write_flag) { if((s->direct || size > s->buffer_size) && !s->update_checksum){ if(s->read_packet) len = s->read_packet(s->opaque, buf, size); @@ -529,6 +529,13 @@ int ffio_read_partial(AVIOContext *s, unsigned char *buf, int size) if (size < 0) return -1; + if (s->read_packet && s->write_flag) { + len = s->read_packet(s->opaque, buf, size); + if (len > 0) + s->pos += len; + return len; + } + len = s->buf_end - s->buf_ptr; if (len == 0) { fill_buffer(s); |