]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtp.c
rtmp: Read and handle incoming packets while writing data
[ffmpeg] / libavformat / rtp.c
index 4be845a06c0c4e6b20f3a13ef27e6775b20c78f7..6516779febf8b289f90d2b574bec3ee233a09e04 100644 (file)
@@ -98,14 +98,17 @@ 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) {
         int64_t payload_type;
-        if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0)
+        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)