avformat/rtpdec: Add support for 24 bit RTSP audio playback
authorTimur Aydin <ta@taydin.org>
Fri, 4 Nov 2016 22:15:44 +0000 (01:15 +0300)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 5 Nov 2016 16:21:57 +0000 (17:21 +0100)
When ffplay is used to play from the RTSP URL that serves 24 bit audio
content, ffplay fails to recognize the audio codec format. The attached
patch adds support for playing 24 bit audio content over RTSP by
defining a dynamic payload handler for "L24".

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/rtpdec.c

index 51feeea..53cdad7 100644 (file)
 
 #define MIN_FEEDBACK_INTERVAL 200000 /* 200 ms in us */
 
+static RTPDynamicProtocolHandler l24_dynamic_handler = {
+    .enc_name   = "L24",
+    .codec_type = AVMEDIA_TYPE_AUDIO,
+    .codec_id   = AV_CODEC_ID_PCM_S24BE,
+};
+
 static RTPDynamicProtocolHandler gsm_dynamic_handler = {
     .enc_name   = "GSM",
     .codec_type = AVMEDIA_TYPE_AUDIO,
@@ -115,6 +121,7 @@ void ff_register_rtp_dynamic_payload_handlers(void)
     ff_register_dynamic_payload_handler(&ff_vp8_dynamic_handler);
     ff_register_dynamic_payload_handler(&ff_vp9_dynamic_handler);
     ff_register_dynamic_payload_handler(&gsm_dynamic_handler);
+    ff_register_dynamic_payload_handler(&l24_dynamic_handler);
     ff_register_dynamic_payload_handler(&opus_dynamic_handler);
     ff_register_dynamic_payload_handler(&realmedia_mp3_dynamic_handler);
     ff_register_dynamic_payload_handler(&speex_dynamic_handler);