Commit 5eaf0182 authored by Pekka Pessi's avatar Pekka Pessi

Moved bitfields last in sdp_rtpmap_t aka struct sdp_rtpmap_s.

darcs-hash:20051125153935-65a35-2981e573693f04c0ef764be7152d1619fa3d1b15.gz
parent 803c119b
......@@ -1744,7 +1744,9 @@ sdp_rtpmap_t *sdp_rtpmap_find_matching(sdp_rtpmap_t const *list,
if (rm->rm_rate != list->rm_rate)
continue;
if (strcasecmp(rm->rm_encoding, list->rm_encoding))
if (rm->rm_encoding != list->rm_encoding &&
!rm->rm_encoding != !list->rm_encoding &&
strcasecmp(rm->rm_encoding, list->rm_encoding) != 0)
continue;
lparam = rm->rm_params; rparam = list->rm_params;
......
......@@ -67,7 +67,7 @@ typedef struct sdp_list_s sdp_list_t;
typedef struct sdp_rtpmap_s sdp_rtpmap_t;
/** Message text */
typedef const char sdp_text_t;
typedef char const sdp_text_t;
#define SDP_MIME_TYPE "application/sdp"
......@@ -309,14 +309,14 @@ struct sdp_list_s
struct sdp_rtpmap_s {
int rm_size; /**< sizeof sdp_rtpmap_t */
sdp_rtpmap_t *rm_next; /**< Next RTP map entry */
unsigned rm_predef : 1; /**< is this entry well-known? */
unsigned rm_pt : 7; /**< Payload type */
unsigned rm_any : 1; /**< Wildcard entry */
unsigned :0;
sdp_text_t *rm_encoding; /**< Codec name */
unsigned long rm_rate; /**< Sampling rate */
sdp_text_t *rm_params; /**< Format-specific parameters */
sdp_text_t *rm_fmtp; /**< Contents of fmtp */
unsigned rm_predef : 1; /**< is this entry well-known? */
unsigned rm_pt : 7; /**< Payload type */
unsigned rm_any : 1; /**< Wildcard entry */
int :0;
};
extern sdp_rtpmap_t const * const sdp_rtpmap_well_known[128];
......
......@@ -1361,8 +1361,8 @@ int sdp_media_has_rtp(sdp_media_t const *m)
return m && (m->m_proto == sdp_proto_rtp || m->m_proto == sdp_proto_srtp);
}
#define RTPMAP(pt, type, rate, params) \
{ sizeof(sdp_rtpmap_t), NULL, 1, pt, 0, type, rate, (char *)params}
#define RTPMAP(pt, encoding, rate, params) \
{ sizeof(sdp_rtpmap_t), NULL, encoding, rate, (char *)params, NULL, 1, pt, 0 }
/* rtpmaps for well-known codecs */
static sdp_rtpmap_t const
......
......@@ -279,7 +279,7 @@ static int test_session2(int flags)
{
#define RTPMAP(pt, type, rate, params) \
{ sizeof(sdp_rtpmap_t), NULL, 1, pt, 0, type, rate, (char *)params}
{ sizeof(sdp_rtpmap_t), NULL, type, rate, (char *)params, NULL, 1, pt, 0 }
/* rtpmaps for well-known video codecs */
static sdp_rtpmap_t const
......@@ -506,14 +506,17 @@ int test_list(int flags)
static
sdp_rtpmap_t const rm0[1] =
{{
sizeof(rm0), NULL, 0, 96, 0, "AMR", 8000, "1",
"mode-set=4,5,6 interleaving crc use-redundancy=1"
sizeof(rm0), NULL, "AMR", 8000, "1",
"mode-set=4,5,6 interleaving crc use-redundancy=1",
0, 96, 0
}};
static
sdp_rtpmap_t const rm1[1] =
{{
sizeof(rm1), (sdp_rtpmap_t *)rm0, 1, 8, 0, "PCMA", 8000, "1", NULL
sizeof(rm1), (sdp_rtpmap_t *)rm0, "PCMA", 8000, "1",
NULL,
1, 8, 0,
}};
/** Test rtpmap-related things */
......@@ -532,6 +535,7 @@ int test_rtpmap(int flags)
TEST(rm->rm_next, NULL);
TEST_S(rm->rm_encoding, "AMR");
TEST_S(rm->rm_params, "1");
TEST(rm->rm_pt, 96);
TEST_S(rm->rm_fmtp, "mode-set=4,5,6 interleaving crc use-redundancy=1");
TEST_1((rm = sdp_rtpmap_dup(home, rm1)));
......@@ -539,6 +543,7 @@ int test_rtpmap(int flags)
TEST_1(rm->rm_next->rm_next == NULL);
TEST_S(rm->rm_encoding, "PCMA");
TEST_S(rm->rm_params, "1");
TEST(rm->rm_pt, 8);
su_home_check(home);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment