On Tue, 17 Jul 2012, Adriano Pallavicino wrote:

---
libavformat/rtp.c |    7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index 6516779..dab8216 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -110,9 +110,10 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, 
AVCodecContext *codec)
                !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)
-                    continue;
+            if (codec->codec_id == CODEC_ID_PCM_S16BE &&
+                (codec->sample_rate != AVRtpPayloadTypes[i].clock_rate ||
+                 codec->channels != AVRtpPayloadTypes[i].audio_channels))
+                continue;
            return AVRtpPayloadTypes[i].pt;
        }

--
1.7.10.4

Looks good to me in general, but I think this can/should be expanded further to cover all audio codecs that have nominal sample rates and channel numbers registered, not only PCM_S16BE. I'll send an improved patch for that.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to