]> git.pld-linux.org Git - packages/mediastreamer.git/blob - libupnp-1.14.patch
44a932347b7bed2cfe9edeffe616c8bad89b9886
[packages/mediastreamer.git] / libupnp-1.14.patch
1 diff -ur mediastreamer-2.16.1/src/upnp/upnp_igd.c mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd.c
2 --- mediastreamer-2.16.1/src/upnp/upnp_igd.c    2017-04-06 11:27:56.000000000 +0200
3 +++ mediastreamer-2.16.1-upnp-1.14/src/upnp/upnp_igd.c  2020-10-23 14:04:57.300609331 +0200
4 @@ -395,7 +395,7 @@
5   *   d_event  -- event associated with the new device
6   *
7   ********************************************************************************/
8 -void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, struct Upnp_Discovery *d_event) {
9 +void upnp_igd_add_device(upnp_igd_context *igd_ctxt, IXML_Document *desc_doc, UpnpDiscovery *d_event) {
10         upnp_igd_device_node *deviceNode, *tmpdevnode;
11         int found = 0;
12         int ret;
13 @@ -423,7 +423,7 @@
14         baseURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "URLBase");
15         relURL = upnp_igd_get_first_document_item(igd_ctxt, desc_doc, "presentationURL");
16  
17 -       ret = UpnpResolveURL((baseURL ? baseURL : d_event->Location), relURL, presURL);
18 +       ret = UpnpResolveURL((baseURL ? baseURL : UpnpDiscovery_get_Location_cstr(d_event)), relURL, presURL);
19  
20         if (UPNP_E_SUCCESS != ret) {
21                 upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error generating presURL from %s + %s", baseURL, relURL);
22 @@ -444,7 +444,7 @@
23                         if (found) {
24                                 /* The device is already there, so just update  */
25                                 /* the advertisement timeout field */
26 -                               tmpdevnode->device.advr_time_out = d_event->Expires;
27 +                               tmpdevnode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
28                                 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "IGD device: %s[%s] | Update expires(%d)", friendlyName, UDN, tmpdevnode->device.advr_time_out);
29                         } else {
30                                 upnp_igd_print(igd_ctxt, UPNP_IGD_MESSAGE, "Add IGD device: %s[%s]", friendlyName, UDN);
31 @@ -453,12 +453,12 @@
32                                 deviceNode = (upnp_igd_device_node *)  malloc(sizeof(upnp_igd_device_node));
33                                 memset(deviceNode->device.services, '\0', sizeof(upnp_igd_service) * IGD_SERVICE_SERVCOUNT);
34                                 strncpy(deviceNode->device.udn, UDN, sizeof(deviceNode->device.udn));
35 -                               strncpy(deviceNode->device.desc_doc_url, d_event->Location, sizeof(deviceNode->device.desc_doc_url));
36 +                               strncpy(deviceNode->device.desc_doc_url, UpnpDiscovery_get_Location_cstr(d_event), sizeof(deviceNode->device.desc_doc_url));
37                                 strncpy(deviceNode->device.friendly_name, friendlyName, sizeof(deviceNode->device.friendly_name));
38                                 strncpy(deviceNode->device.model_name, modelName, sizeof(deviceNode->device.model_name));
39                                 strncpy(deviceNode->device.model_number, modelNumber, sizeof(deviceNode->device.model_number));
40                                 strncpy(deviceNode->device.pres_url, presURL, sizeof(deviceNode->device.pres_url));
41 -                               deviceNode->device.advr_time_out = d_event->Expires;
42 +                               deviceNode->device.advr_time_out = UpnpDiscovery_get_Expires(d_event);
43  
44                                 // Reset values
45                                 serviceId = NULL;
46 @@ -468,7 +468,7 @@
47  
48                                 for (service = 0; service < IGD_SERVICE_SERVCOUNT;
49                                      service++) {
50 -                                       if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, d_event->Location,
51 +                                       if (upnp_igd_get_find_and_parse_service(igd_ctxt, desc_doc, UpnpDiscovery_get_Location_cstr(d_event),
52                                                         IGDServiceType[service], &serviceId, &event_url, &controlURL)) {
53                                                 upnp_igd_print(igd_ctxt, UPNP_IGD_DEBUG, "Subscribing to EventURL %s...",event_url);
54                                                 ret =
55 @@ -891,16 +891,16 @@
56         switch(event_type) {
57         case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
58         case UPNP_DISCOVERY_SEARCH_RESULT: {
59 -               struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
60 +               UpnpDiscovery *d_event = (UpnpDiscovery *)event;
61                 IXML_Document *desc_doc = NULL;
62                 int ret;
63  
64 -               if (d_event->ErrCode != UPNP_E_SUCCESS) {
65 -                       upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", d_event->ErrCode);
66 +               if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
67 +                       upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
68                 }
69 -               ret = UpnpDownloadXmlDoc(d_event->Location, &desc_doc);
70 +               ret = UpnpDownloadXmlDoc(UpnpDiscovery_get_Location_cstr(d_event), &desc_doc);
71                 if (ret != UPNP_E_SUCCESS) {
72 -                       upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", d_event->Location, ret);
73 +                       upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error obtaining device description from %s -- error = %d", UpnpDiscovery_get_Location_cstr(d_event), ret);
74                 } else {
75                         upnp_igd_add_device(igd_ctxt, desc_doc, d_event);
76                 }
77 @@ -910,11 +910,11 @@
78         }
79         break;
80         case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE: {
81 -               struct Upnp_Discovery *d_event = (struct Upnp_Discovery *)event;
82 -               if (d_event->ErrCode != UPNP_E_SUCCESS) {
83 -                       upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", d_event->ErrCode);
84 +               UpnpDiscovery *d_event = (UpnpDiscovery *)event;
85 +               if (UpnpDiscovery_get_ErrCode(d_event) != UPNP_E_SUCCESS) {
86 +                       upnp_igd_print(igd_ctxt, UPNP_IGD_ERROR, "Error in Discovery ByeBye Callback -- %d", UpnpDiscovery_get_ErrCode(d_event));
87                 }
88 -               upnp_igd_remove_device(igd_ctxt, d_event->DeviceId);
89 +               upnp_igd_remove_device(igd_ctxt, UpnpDiscovery_get_DeviceID_cstr(d_event));
90         }
91         break;
92         /* SOAP Stuff */
This page took 0.05676 seconds and 3 git commands to generate.