[FFmpeg-cvslog] r20135 - trunk/libavformat/aviobuf.c
reimar
subversion
Fri Oct 2 08:36:39 CEST 2009
Author: reimar
Date: Fri Oct 2 08:36:39 2009
New Revision: 20135
Log:
Make get_buffer and get_partial_buffer return url_ferror or AVERROR_EOF as
appropriate if it couldn't read any data at all.
This should make handling of EOF and error simpler or make it work right without
extra code in a few place (e.g. raw demuxer).
Modified:
trunk/libavformat/aviobuf.c
Modified: trunk/libavformat/aviobuf.c
==============================================================================
--- trunk/libavformat/aviobuf.c Thu Oct 1 23:38:25 2009 (r20134)
+++ trunk/libavformat/aviobuf.c Fri Oct 2 08:36:39 2009 (r20135)
@@ -415,6 +415,10 @@ int get_buffer(ByteIOContext *s, unsigne
size -= len;
}
}
+ if (size1 == size) {
+ if (url_ferror(s)) return url_ferror(s);
+ if (url_feof(s)) return AVERROR_EOF;
+ }
return size1 - size;
}
@@ -434,6 +438,10 @@ int get_partial_buffer(ByteIOContext *s,
len = size;
memcpy(buf, s->buf_ptr, len);
s->buf_ptr += len;
+ if (!len) {
+ if (url_ferror(s)) return url_ferror(s);
+ if (url_feof(s)) return AVERROR_EOF;
+ }
return len;
}
More information about the ffmpeg-cvslog
mailing list