Mercurial > libavformat.hg
diff rtpdec.c @ 6255:e87b379e8816 libavformat
rtpdec: Allow depacketizers to specify that pkt->pts should be left as AV_NOPTS_VALUE
author | mstorsjo |
---|---|
date | Wed, 14 Jul 2010 12:26:16 +0000 |
parents | 209c43ef17af |
children | 0689434db2c6 |
line wrap: on
line diff
--- a/rtpdec.c Mon Jul 12 18:52:03 2010 +0000 +++ b/rtpdec.c Wed Jul 14 12:26:16 2010 +0000 @@ -375,7 +375,7 @@ */ static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp) { - if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE) { + if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE && timestamp != RTP_NOTS_VALUE) { int64_t addend; int delta_timestamp; @@ -408,7 +408,9 @@ if (!buf) { /* return the next packets, if any */ if(s->st && s->parse_packet) { - timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned.... + /* timestamp should be overwritten by parse_packet, if not, + * the packet is left with pts == AV_NOPTS_VALUE */ + timestamp = RTP_NOTS_VALUE; rv= s->parse_packet(s->ic, s->dynamic_protocol_context, s->st, pkt, ×tamp, NULL, 0, flags); finalize_packet(s, pkt, timestamp);