summaryrefslogtreecommitdiffstats
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 0b88afa..8311e4c 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -471,8 +471,11 @@ static int rtp_parse_packet_internal(RTPDemuxContext *s, AVPacket *pkt,
if (!st) {
/* specific MPEG2TS demux support */
ret = ff_mpegts_parse_packet(s->ts, pkt, buf, len);
+ /* The only error that can be returned from ff_mpegts_parse_packet
+ * is "no more data to return from the provided buffer", so return
+ * AVERROR(EAGAIN) for all errors */
if (ret < 0)
- return ret;
+ return AVERROR(EAGAIN);
if (ret < len) {
s->read_buf_size = len - ret;
memcpy(s->buf, buf + ret, s->read_buf_size);
@@ -634,7 +637,7 @@ static int rtp_parse_one_packet(RTPDemuxContext *s, AVPacket *pkt,
ret = ff_mpegts_parse_packet(s->ts, pkt, s->buf + s->read_buf_index,
s->read_buf_size - s->read_buf_index);
if (ret < 0)
- return ret;
+ return AVERROR(EAGAIN);
s->read_buf_index += ret;
if (s->read_buf_index < s->read_buf_size)
return 1;
OpenPOWER on IntegriCloud