diff options
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r-- | libavformat/rmdec.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 54267485b7..5ee75b53b9 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -568,7 +568,8 @@ skip: static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, RMDemuxContext *rm, RMStream *vst, - AVPacket *pkt, int len, int *pseq) + AVPacket *pkt, int len, int *pseq, + int64_t *timestamp) { int hdr, seq, pic_num, len2, pos; int type; @@ -588,8 +589,10 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, return -1; rm->remaining_len = len; if(type&1){ // frame, not slice - if(type == 3) // frame as a part of packet + if(type == 3){ // frame as a part of packet len= len2; + *timestamp = pos; + } if(rm->remaining_len < len) return -1; rm->remaining_len -= len; @@ -697,7 +700,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { rm->current_stream= st->id; - if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq)) + if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq, ×tamp)) return -1; //got partial frame } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if ((st->codec->codec_id == CODEC_ID_RA_288) || @@ -772,7 +775,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, } #endif - pkt->pts= timestamp; + pkt->pts = timestamp; if (flags & 2) pkt->flags |= AV_PKT_FLAG_KEY; |