Revision 34bddc39

View differences:

libavformat/rdt.c
308 308
        init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
309 309
        flags = (flags & RTP_FLAG_KEY) ? 2 : 0;
310 310
        res = ff_rm_parse_packet (rdt->rmctx, &pb, st, rdt->rmst[st->index], len, pkt,
311
                                  &seq, &flags, timestamp);
311
                                  &seq, flags, *timestamp);
312 312
        pos = url_ftell(&pb);
313 313
        if (res < 0)
314 314
            return res;
libavformat/rm.h
61 61
 * @param pkt packet location to store the parsed packet data
62 62
 * @param seq pointer to an integer containing the sequence number, may be
63 63
 *            updated
64
 * @param flags pointer to an integer containing the packet flags, may be
65
                updated
66
 * @param ts pointer to timestamp, may be updated
64
 * @param flags the packet flags
65
 * @param ts timestamp of the current packet
67 66
 * @return <0 on error, 0 if a packet was placed in the pkt pointer. A
68 67
 *         value >0 means that no data was placed in pkt, but that cached
69 68
 *         data is available by calling ff_rm_retrieve_cache().
70 69
 */
71 70
int ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
72 71
                        AVStream *st, RMStream *rst, int len,
73
                        AVPacket *pkt, int *seq, int *flags, int64_t *ts);
72
                        AVPacket *pkt, int *seq, int flags, int64_t ts);
74 73

  
75 74
/**
76 75
 * Retrieve one cached packet from the rm-context. The real container can
libavformat/rmdec.c
689 689
int
690 690
ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
691 691
                    AVStream *st, RMStream *ast, int len, AVPacket *pkt,
692
                    int *seq, int *flags, int64_t *timestamp)
692
                    int *seq, int flags, int64_t timestamp)
693 693
{
694 694
    RMDemuxContext *rm = s->priv_data;
695 695

  
......
709 709
            int y = ast->sub_packet_cnt;
710 710
            int w = ast->audio_framesize;
711 711

  
712
            if (*flags & 2)
712
            if (flags & 2)
713 713
                y = ast->sub_packet_cnt = 0;
714 714
            if (!y)
715
                ast->audiotimestamp = *timestamp;
715
                ast->audiotimestamp = timestamp;
716 716

  
717 717
            switch(st->codec->codec_id) {
718 718
                case CODEC_ID_RA_288:
......
745 745
                for (x = 0; x < ast->sub_packet_cnt; x++)
746 746
                    ast->sub_packet_lengths[x] = get_be16(pb);
747 747
                rm->audio_pkt_cnt = ast->sub_packet_cnt;
748
                ast->audiotimestamp = *timestamp;
748
                ast->audiotimestamp = timestamp;
749 749
            } else
750 750
                return -1;
751 751
        } else {
......
763 763
            int seq= 128*(pkt->data[2]&0x7F) + (pkt->data[3]>>1);
764 764
            av_log(s, AV_LOG_DEBUG, "%d %"PRId64" %d\n", *timestamp, *timestamp*512LL/25, seq);
765 765

  
766
            seq |= (*timestamp&~0x3FFF);
767
            if(seq - *timestamp >  0x2000) seq -= 0x4000;
768
            if(seq - *timestamp < -0x2000) seq += 0x4000;
766
            seq |= (timestamp&~0x3FFF);
767
            if(seq - timestamp >  0x2000) seq -= 0x4000;
768
            if(seq - timestamp < -0x2000) seq += 0x4000;
769 769
        }
770 770
    }
771 771
#endif
772 772

  
773
    pkt->pts= *timestamp;
774
    if (*flags & 2)
773
    pkt->pts= timestamp;
774
    if (flags & 2)
775 775
        pkt->flags |= PKT_FLAG_KEY;
776 776

  
777 777
    return st->codec->codec_type == CODEC_TYPE_AUDIO ? rm->audio_pkt_cnt : 0;
......
838 838

  
839 839
            old_flags = flags;
840 840
            res = ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
841
                                      &seq, &flags, &timestamp);
841
                                      &seq, flags, timestamp);
842 842
            if((old_flags&2) && (seq&0x7F) == 1)
843 843
                av_add_index_entry(st, pos, timestamp, 0, 0, AVINDEX_KEYFRAME);
844 844
            if (res)

Also available in: Unified diff