]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtp.c
rtmp: Read and handle incoming packets while writing data
[ffmpeg] / libavformat / rtp.c
index bb4bc17d3fc357caeb9502f77e2c5f89b4b3a96a..6516779febf8b289f90d2b574bec3ee233a09e04 100644 (file)
@@ -97,15 +97,18 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec)
 
     /* Was the payload type already specified for the RTP muxer? */
     if (ofmt && ofmt->priv_class) {
-        int payload_type = av_get_int(fmt->priv_data, "payload_type", NULL);
-        if (payload_type >= 0)
-            return payload_type;
+        int64_t payload_type;
+        if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 &&
+            payload_type >= 0)
+            return (int)payload_type;
     }
 
     /* static payload type */
     for (i = 0; AVRtpPayloadTypes[i].pt >= 0; ++i)
         if (AVRtpPayloadTypes[i].codec_id == codec->codec_id) {
-            if (codec->codec_id == CODEC_ID_H263)
+            if (codec->codec_id == CODEC_ID_H263 && (!fmt ||
+                !fmt->oformat->priv_class ||
+                !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
                 continue;
             if (codec->codec_id == CODEC_ID_PCM_S16BE)
                 if (codec->channels != AVRtpPayloadTypes[i].audio_channels)