[FFmpeg-cvslog] r24234 - in trunk/libavformat: rtpdec.c rtpdec.h
mstorsjo
subversion
Wed Jul 14 14:26:16 CEST 2010
Author: mstorsjo
Date: Wed Jul 14 14:26:16 2010
New Revision: 24234
Log:
rtpdec: Allow depacketizers to specify that pkt->pts should be left as AV_NOPTS_VALUE
Modified:
trunk/libavformat/rtpdec.c
trunk/libavformat/rtpdec.h
Modified: trunk/libavformat/rtpdec.c
==============================================================================
--- trunk/libavformat/rtpdec.c Wed Jul 14 06:10:52 2010 (r24233)
+++ trunk/libavformat/rtpdec.c Wed Jul 14 14:26:16 2010 (r24234)
@@ -375,7 +375,7 @@ rtp_parse_set_dynamic_protocol(RTPDemuxC
*/
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,
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);
Modified: trunk/libavformat/rtpdec.h
==============================================================================
--- trunk/libavformat/rtpdec.h Wed Jul 14 06:10:52 2010 (r24233)
+++ trunk/libavformat/rtpdec.h Wed Jul 14 14:26:16 2010 (r24234)
@@ -34,6 +34,8 @@ typedef struct RTPDynamicProtocolHandler
#define RTP_MIN_PACKET_LENGTH 12
#define RTP_MAX_PACKET_LENGTH 1500 /* XXX: suppress this define */
+#define RTP_NOTS_VALUE ((uint32_t)-1)
+
typedef struct RTPDemuxContext RTPDemuxContext;
RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type);
void rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx,
More information about the ffmpeg-cvslog
mailing list