summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Elder <aelder@audioscience.com>2013-03-29 17:11:13 -0400
committerAndrew Elder <aelder@audioscience.com>2013-05-20 16:42:09 -0400
commit49b2643f393e022bf0179e5df6dc8329de1dd2d8 (patch)
tree7bada1f91da08545ef840d5caf14aca53e5fc377
parent850108b42c29b4881d49b3d35e3c7bca3a832f89 (diff)
downloadOpen-AVB-49b2643f393e022bf0179e5df6dc8329de1dd2d8.tar.gz
mrp: MSRP: bugfix for 4 listener stream case
This checkin fixes 2 issues in msrp_emit_listenvectors(): 1) when listener streams with incrementing stream ID are registered the attributes are aggregated, but there was no test for whether the attribute had already been tx'd, so stream declarations were repeated. The fix is to mark all attributes for tx before looping through the tx pack operation and then test the tx flag inside the tx pack loop. 2) incorrect conditional in vect_4pack operation
-rw-r--r--daemons/mrpd/msrp.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/daemons/mrpd/msrp.c b/daemons/mrpd/msrp.c
index e2101ef2..967199cd 100644
--- a/daemons/mrpd/msrp.c
+++ b/daemons/mrpd/msrp.c
@@ -1580,6 +1580,9 @@ msrp_emit_domainvectors(unsigned char *msgbuf, unsigned char *msgbuf_eof,
*/
vectidx = 4;
+
+/* pending review and deletion */
+#ifdef MSRP_AGGREGATE_DOMAINS_VECTORS
vattrib = attrib->next;
while (NULL != vattrib) {
@@ -1658,6 +1661,7 @@ msrp_emit_domainvectors(unsigned char *msgbuf, unsigned char *msgbuf_eof,
vattrib = vattrib->next;
}
+#endif
/* handle any trailers */
if (vectevt_idx > 0) {
@@ -2038,8 +2042,18 @@ msrp_emit_listenvectors(unsigned char *msgbuf, unsigned char *msgbuf_eof,
if (NULL == listen_declare)
goto oops;
+ /* if we have a listener type registered, always send out an update,
+ * so mark all as ready.
+ */
attrib = MSRP_db->attrib_list;
+ while(attrib) {
+ if (MSRP_LISTENER_TYPE == attrib->type) {
+ attrib->applicant.tx = 1;
+ }
+ attrib = attrib->next;
+ }
+ attrib = MSRP_db->attrib_list;
mrpdu_vectorptr = (mrpdu_vectorattrib_t *) & (mrpdu_msg->Data[2]);
while ((mrpdu_msg_ptr < (mrpdu_msg_eof - 2)) && (NULL != attrib)) {
@@ -2049,6 +2063,11 @@ msrp_emit_listenvectors(unsigned char *msgbuf, unsigned char *msgbuf_eof,
continue;
}
+ if (0 == attrib->applicant.tx) {
+ attrib = attrib->next;
+ continue;
+ }
+
listen_declare_idx = 0;
/* if we have a listener type registered, we always will
@@ -2237,8 +2256,7 @@ msrp_emit_listenvectors(unsigned char *msgbuf, unsigned char *msgbuf_eof,
> (mrpdu_msg_eof - 2))
goto oops;
- if (vectevt_idx > 3) {
- vect_4pack =
+ vect_4pack =
MRPDU_4PACK_ENCODE(listen_declare
[listen_declare_idx],
listen_declare
@@ -2249,15 +2267,13 @@ msrp_emit_listenvectors(unsigned char *msgbuf, unsigned char *msgbuf_eof,
[listen_declare_idx +
3]);
- mrpdu_vectorptr->FirstValue_VectorEvents
+ mrpdu_vectorptr->FirstValue_VectorEvents
[vectidx] = vect_4pack;
- vectidx++;
- }
+ vectidx++;
if (&(mrpdu_vectorptr->FirstValue_VectorEvents[vectidx])
> (mrpdu_msg_eof - 3))
goto oops;
-
}
/* handle any trailers */