From 3dc590ec1a33912e8c7425b553b8fe6306ce4279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20B=C3=A9rub=C3=A9?= Date: Wed, 10 Jul 2024 09:08:22 -0400 Subject: [PATCH] Fixing the RTSP DESCRIBE message when no audio is present --- src/hal/types.h | 3 ++- src/rtsp/rtsp.c | 4 ++-- src/rtsp/rtsp.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hal/types.h b/src/hal/types.h index 6c4badb..de46462 100644 --- a/src/hal/types.h +++ b/src/hal/types.h @@ -35,7 +35,8 @@ typedef enum { typedef enum { HAL_AUDCODEC_UNSPEC, - HAL_AUDCODEC_MP3 = 0x69 + HAL_AUDCODEC_MP3 = 0x69, + HAL_AUDCODEC_NONE = 0xFF } hal_audcodec; typedef enum { diff --git a/src/rtsp/rtsp.c b/src/rtsp/rtsp.c index 4db997b..5e15989 100644 --- a/src/rtsp/rtsp.c +++ b/src/rtsp/rtsp.c @@ -263,7 +263,7 @@ static void __method_describe(struct connection_item_t *p, rtsp_handle h) char audioRtp[256] = "\r\n"; char audioRtpfmt[16]; - if (h->audioPt) { + if (h->audioPt != 255) { switch (h->audioPt) { case 0: sprintf(audioRtpfmt, "PCMU"); @@ -911,7 +911,7 @@ rtsp_handle rtsp_create(unsigned char max_con, int priority) TALLOC(nh,return NULL); - nh->audioPt = -1; + nh->audioPt = 255; nh->max_con = max_con; nh->priority = priority; diff --git a/src/rtsp/rtsp.h b/src/rtsp/rtsp.h index 228d51d..ac688d3 100644 --- a/src/rtsp/rtsp.h +++ b/src/rtsp/rtsp.h @@ -125,7 +125,7 @@ struct __rtsp_obj_t { unsigned short port; struct __time_stat_t stat; char isH265; - char audioPt; + unsigned char audioPt; mime_encoded_handle sprop_vps_b64; mime_encoded_handle sprop_sps_b64; mime_encoded_handle sprop_pps_b64;