]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpdec.c
only print debug info when sample is actually added
[ffmpeg] / libavformat / rtpdec.c
index f5e2d6dd6f7694fd909dfae0423e3013d3203f2b..dc9e0442272a163422af74d842639768156c6aeb 100644 (file)
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
+
+#include "libavcodec/bitstream.h"
 #include "avformat.h"
 #include "mpegts.h"
-#include "bitstream.h"
 
 #include <unistd.h>
 #include "network.h"
@@ -318,7 +319,7 @@ static int rtp_parse_mp4_au(RTPDemuxContext *s, const uint8_t *buf)
     if (infos == NULL)
         return -1;
 
-    /* decode the first 2 bytes where are stored the AUHeader sections
+    /* decode the first 2 bytes where the AUHeader sections are stored
        length in bits */
     au_headers_length = AV_RB16(buf);
 
@@ -402,7 +403,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
                      const uint8_t *buf, int len)
 {
     unsigned int ssrc, h;
-    int payload_type, seq, ret;
+    int payload_type, seq, ret, flags = 0;
     AVStream *st;
     uint32_t timestamp;
     int rv= 0;
@@ -411,7 +412,7 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
         /* 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....
-            rv= s->parse_packet(s, pkt, &timestamp, NULL, 0);
+            rv= s->parse_packet(s, pkt, &timestamp, NULL, 0, flags);
             finalize_packet(s, pkt, timestamp);
             return rv;
         } else {
@@ -474,6 +475,8 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
             s->read_buf_index = 0;
             return 1;
         }
+    } else if (s->parse_packet) {
+        rv = s->parse_packet(s, pkt, &timestamp, buf, len, flags);
     } else {
         // at this point, the RTP header has been stripped;  This is ASSUMING that there is only 1 CSRC, which in't wise.
         switch(st->codec->codec_id) {
@@ -529,12 +532,8 @@ int rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt,
             rv= 0;
             break;
         default:
-            if(s->parse_packet) {
-                rv= s->parse_packet(s, pkt, &timestamp, buf, len);
-            } else {
-                av_new_packet(pkt, len);
-                memcpy(pkt->data, buf, len);
-            }
+            av_new_packet(pkt, len);
+            memcpy(pkt->data, buf, len);
             break;
         }