in the raw demuxers.
Also remove special handling of 0-size reads, if they are due to an error/eof,
these are already converted to the appropriate error by get_buffer.
Originally committed as revision 20137 to svn://svn.ffmpeg.org/ffmpeg/trunk
ret= av_get_packet(s->pb, pkt, size);
pkt->stream_index = 0;
- if (ret <= 0) {
- return AVERROR(EIO);
- }
+ if (ret < 0)
+ return ret;
bps= av_get_bits_per_sample(s->streams[0]->codec->codec_id);
assert(bps); // if false there IS a bug elsewhere (NOT in this function)
pkt->pos= url_ftell(s->pb);
pkt->stream_index = 0;
ret = get_partial_buffer(s->pb, pkt->data, size);
- if (ret <= 0) {
+ if (ret < 0) {
av_free_packet(pkt);
- return AVERROR(EIO);
+ return ret;
}
pkt->size = ret;
return ret;
pkt->dts= pkt->pos / packet_size;
pkt->stream_index = 0;
- if (ret <= 0)
- return AVERROR(EIO);
+ if (ret < 0)
+ return ret;
return 0;
}
#endif
pkt->pos = url_ftell(s->pb);
pkt->stream_index = 0;
ret = get_buffer(s->pb, pkt->data, size);
- if (ret <= 0) {
+ if (ret < 0) {
av_free_packet(pkt);
- return AVERROR(EIO);
+ return ret;
}
pkt->size = ret;
return ret;