summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-10-08 08:40:08 +0000
committerMartin Storsjö <martin@martin.st>2010-10-08 08:40:08 +0000
commitb7952ed184554e2200ac80979858b89d6f17412a (patch)
tree315219f738bf07d16179ba01fb5984b07dcd981b /libavformat/rtpdec.c
parent45658b7414870cfe84bb70e6ec2c6e59b7c95b8b (diff)
downloadffmpeg-b7952ed184554e2200ac80979858b89d6f17412a.tar.gz
rtpdec: Set prev_ret properly when parsing more data from mpegts RTP packets
Originally committed as revision 25404 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r--libavformat/rtpdec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index fed166cf62..033f336996 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -644,12 +644,16 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
return rv ? rv : has_next_packet(s);
} else {
// TODO: Move to a dynamic packet handler (like above)
- if (s->read_buf_index >= s->read_buf_size)
+ if (s->read_buf_index >= s->read_buf_size) {
+ s->prev_ret = -1;
return -1;
+ }
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)
+ if (ret < 0) {
+ s->prev_ret = -1;
return -1;
+ }
s->read_buf_index += ret;
if (s->read_buf_index < s->read_buf_size)
return 1;