]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec.c
Add functions to return library license and library configuration.
[ffmpeg] / libavformat / rtpdec.c
index 5b7d63db12559d2e948aeca42a230d07ae7ab59d..48995e7de4d1ad50deab81372bf4ea146007ba64 100644 (file)
@@ -22,7 +22,7 @@
 /* needed for gethostname() */
 #define _XOPEN_SOURCE 600
 
-#include "libavcodec/bitstream.h"
+#include "libavcodec/get_bits.h"
 #include "avformat.h"
 #include "mpegts.h"
 
@@ -30,7 +30,9 @@
 #include "network.h"
 
 #include "rtpdec.h"
+#include "rtp_asf.h"
 #include "rtp_h264.h"
+#include "rtp_vorbis.h"
 
 //#define DEBUG
 
@@ -60,6 +62,10 @@ void av_register_rtp_dynamic_payload_handlers(void)
     ff_register_dynamic_payload_handler(&mp4v_es_handler);
     ff_register_dynamic_payload_handler(&mpeg4_generic_handler);
     ff_register_dynamic_payload_handler(&ff_h264_dynamic_handler);
+    ff_register_dynamic_payload_handler(&ff_vorbis_dynamic_handler);
+
+    ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfv_handler);
+    ff_register_dynamic_payload_handler(&ff_ms_rtp_asf_pfa_handler);
 }
 
 static int rtcp_parse_packet(RTPDemuxContext *s, const unsigned char *buf, int len)
@@ -382,7 +388,6 @@ static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestam
         addend = av_rescale(s->last_rtcp_ntp_time - s->first_rtcp_ntp_time, s->st->time_base.den, (uint64_t)s->st->time_base.num << 32);
         pkt->pts = addend + delta_timestamp;
     }
-    pkt->stream_index = s->st->index;
 }
 
 /**
@@ -437,6 +442,8 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
         return -1;
     }
     payload_type = buf[1] & 0x7f;
+    if (buf[1] & 0x80)
+        flags |= RTP_FLAG_MARKER;
     seq  = AV_RB16(buf + 2);
     timestamp = AV_RB32(buf + 4);
     ssrc = AV_RB32(buf + 8);
@@ -471,6 +478,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
             s->read_buf_index = 0;
             return 1;
         }
+        return 0;
     } else if (s->parse_packet) {
         rv = s->parse_packet(s->ic, s->dynamic_protocol_context,
                              s->st, pkt, &timestamp, buf, len, flags);
@@ -534,9 +542,12 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
             break;
         }
 
-        // now perform timestamp things....
-        finalize_packet(s, pkt, timestamp);
+        pkt->stream_index = st->index;
     }
+
+    // now perform timestamp things....
+    finalize_packet(s, pkt, timestamp);
+
     return rv;
 }