diff options
author | Ivan Schreter <schreter@gmx.net> | 2009-03-05 07:36:16 +0000 |
---|---|---|
committer | Ivan Schreter <schreter@gmx.net> | 2009-03-05 07:36:16 +0000 |
commit | 61c23c155cf0709df69222a1f3e49bfa263a70e1 (patch) | |
tree | 14e4ebed0ce634ffc6403546b08eae9a0099b78b /libavformat | |
parent | b283ba26cefe18f14ee493f758056afd2efa5999 (diff) | |
download | ffmpeg-61c23c155cf0709df69222a1f3e49bfa263a70e1.tar.gz |
Pass packet position to the parser, so frame's AVPacket.pos is computed correctly.
Originally committed as revision 17824 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avformat.h | 2 | ||||
-rw-r--r-- | libavformat/utils.c | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 18ec2c86f9..da23709398 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -23,7 +23,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 52 #define LIBAVFORMAT_VERSION_MINOR 31 -#define LIBAVFORMAT_VERSION_MICRO 0 +#define LIBAVFORMAT_VERSION_MICRO 1 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ diff --git a/libavformat/utils.c b/libavformat/utils.c index 719b15bc31..d8bd85c2a8 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -956,9 +956,10 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) s->cur_st = NULL; break; } else if (st->cur_len > 0 && st->discard < AVDISCARD_ALL) { - len = av_parser_parse(st->parser, st->codec, &pkt->data, &pkt->size, - st->cur_ptr, st->cur_len, - st->cur_pkt.pts, st->cur_pkt.dts); + len = av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, + st->cur_ptr, st->cur_len, + st->cur_pkt.pts, st->cur_pkt.dts, + st->cur_pkt.pos); st->cur_pkt.pts = AV_NOPTS_VALUE; st->cur_pkt.dts = AV_NOPTS_VALUE; /* increment read pointer */ @@ -967,12 +968,12 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) /* return packet if any */ if (pkt->size) { - pkt->pos = st->cur_pkt.pos; // Isn't quite accurate but close. got_packet: pkt->duration = 0; pkt->stream_index = st->index; pkt->pts = st->parser->pts; pkt->dts = st->parser->dts; + pkt->pos = st->parser->pos; pkt->destruct = av_destruct_packet_nofree; compute_pkt_fields(s, st, st->parser, pkt); @@ -1000,10 +1001,11 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) for(i = 0; i < s->nb_streams; i++) { st = s->streams[i]; if (st->parser && st->need_parsing) { - av_parser_parse(st->parser, st->codec, + av_parser_parse2(st->parser, st->codec, &pkt->data, &pkt->size, NULL, 0, - AV_NOPTS_VALUE, AV_NOPTS_VALUE); + AV_NOPTS_VALUE, AV_NOPTS_VALUE, + AV_NOPTS_VALUE); if (pkt->size) goto got_packet; } |