diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-05-27 17:11:37 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-05-27 17:11:37 +0000 |
commit | a5266a4789dd9477e062c28ae1ae00dfb75c038a (patch) | |
tree | d3eabf11c59ed3a3750a04832a02f3a77ffc8747 | |
parent | 5d55bb9f11ec955efbe21d055f45aabc7c606b2b (diff) | |
download | ffmpeg-a5266a4789dd9477e062c28ae1ae00dfb75c038a.tar.gz |
Make sure that when the parser is feeded with frame==packet that the
packets are passed through and wont be marked as static which would
require them to be copied by av_dup_packet().
Originally committed as revision 23352 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d1b77705e5..bd8c6bc37d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1044,7 +1044,15 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) pkt->pts = st->parser->pts; pkt->dts = st->parser->dts; pkt->pos = st->parser->pos; + if(pkt->data == st->cur_pkt.data && pkt->size == st->cur_pkt.size){ + s->cur_st = NULL; + pkt->destruct= st->cur_pkt.destruct; + st->cur_pkt.destruct= + st->cur_pkt.data = NULL; + assert(st->cur_len == 0); + }else{ pkt->destruct = NULL; + } compute_pkt_fields(s, st, st->parser, pkt); if((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & AV_PKT_FLAG_KEY){ |