diff options
author | John Brooks <john.brooks@bluecherry.net> | 2011-11-09 16:28:35 -0700 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2011-11-11 14:26:37 +0200 |
commit | b8a1b880ee155f4f27389f7f76a58a1d87eb7008 (patch) | |
tree | 7bdb86f24858417e2c342cb368c8e3749141678c | |
parent | b911518d1c17223aa7fb83ace08b2bd41c203da0 (diff) | |
download | ffmpeg-b8a1b880ee155f4f27389f7f76a58a1d87eb7008.tar.gz |
rtpdec: Simplify finalize_packet
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/rtpdec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index 1e6bd6eee7..a5ec1caf7a 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -421,7 +421,10 @@ static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestam { if (pkt->pts != AV_NOPTS_VALUE || pkt->dts != AV_NOPTS_VALUE) return; /* Timestamp already set by depacketizer */ - if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE && timestamp != RTP_NOTS_VALUE) { + if (timestamp == RTP_NOTS_VALUE) + return; + + if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE) { int64_t addend; int delta_timestamp; @@ -433,8 +436,7 @@ static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestam delta_timestamp; return; } - if (timestamp == RTP_NOTS_VALUE) - return; + if (!s->base_timestamp) s->base_timestamp = timestamp; pkt->pts = s->range_start_offset + timestamp - s->base_timestamp; |