diff options
author | Martin Storsjö <martin@martin.st> | 2010-07-14 12:26:16 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-07-14 12:26:16 +0000 |
commit | d74c6145fb1873a7c301581756fba88465e078e5 (patch) | |
tree | 8c911fccfa14acc73c8ff513f96f5c6724520716 /libavformat/rtpdec.c | |
parent | 49d3aab76468739f4c7c38dc9ecf5e570d14abc1 (diff) | |
download | ffmpeg-d74c6145fb1873a7c301581756fba88465e078e5.tar.gz |
rtpdec: Allow depacketizers to specify that pkt->pts should be left as AV_NOPTS_VALUE
Originally committed as revision 24234 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec.c')
-rw-r--r-- | libavformat/rtpdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index ca06bfff00..4922ce3820 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -375,7 +375,7 @@ rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, */ 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 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, 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); |