Mercurial > libavformat.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
6254:feec446a2dc1 | 6255:e87b379e8816 |
---|---|
373 /** | 373 /** |
374 * This was the second switch in rtp_parse packet. Normalizes time, if required, sets stream_index, etc. | 374 * This was the second switch in rtp_parse packet. Normalizes time, if required, sets stream_index, etc. |
375 */ | 375 */ |
376 static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp) | 376 static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp) |
377 { | 377 { |
378 if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE) { | 378 if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE && timestamp != RTP_NOTS_VALUE) { |
379 int64_t addend; | 379 int64_t addend; |
380 int delta_timestamp; | 380 int delta_timestamp; |
381 | 381 |
382 /* compute pts from timestamp with received ntp_time */ | 382 /* compute pts from timestamp with received ntp_time */ |
383 delta_timestamp = timestamp - s->last_rtcp_timestamp; | 383 delta_timestamp = timestamp - s->last_rtcp_timestamp; |
406 int rv= 0; | 406 int rv= 0; |
407 | 407 |
408 if (!buf) { | 408 if (!buf) { |
409 /* return the next packets, if any */ | 409 /* return the next packets, if any */ |
410 if(s->st && s->parse_packet) { | 410 if(s->st && s->parse_packet) { |
411 timestamp= 0; ///< Should not be used if buf is NULL, but should be set to the timestamp of the packet returned.... | 411 /* timestamp should be overwritten by parse_packet, if not, |
412 * the packet is left with pts == AV_NOPTS_VALUE */ | |
413 timestamp = RTP_NOTS_VALUE; | |
412 rv= s->parse_packet(s->ic, s->dynamic_protocol_context, | 414 rv= s->parse_packet(s->ic, s->dynamic_protocol_context, |
413 s->st, pkt, ×tamp, NULL, 0, flags); | 415 s->st, pkt, ×tamp, NULL, 0, flags); |
414 finalize_packet(s, pkt, timestamp); | 416 finalize_packet(s, pkt, timestamp); |
415 return rv; | 417 return rv; |
416 } else { | 418 } else { |