extra/vlc: add patch

This commit is contained in:
Kevin Mihelich 2018-01-12 02:18:00 +00:00
parent 70232b6198
commit 69e3a0bcd8

View file

@ -0,0 +1,143 @@
From 17faa5cd8e2dd041f87e1a2ee2789513d363dd63 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Thu, 11 Jan 2018 18:56:13 -0700
Subject: [PATCH] Revert "upnp: Add support for libupnp 1.8"
This reverts commit 825dca78be3a81e2a1c5d04137aa01b1cb32dfd3.
---
modules/services_discovery/upnp.cpp | 63 +++++++------------------------------
1 file changed, 12 insertions(+), 51 deletions(-)
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index 9b6ed8727a..b5f74097fb 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -40,44 +40,6 @@
#include <assert.h>
#include <limits.h>
-#if UPNP_VERSION < 10800
-/*
- * Compat functions and typedefs for libupnp prior to 1.8
- */
-typedef void* UpnpEventPtr;
-typedef Upnp_Discovery UpnpDiscovery;
-typedef Upnp_Action_Complete UpnpActionComplete;
-typedef Upnp_Event UpnpEvent;
-typedef Upnp_Event_Subscribe UpnpEventSubscribe;
-
-static const char* UpnpDiscovery_get_Location_cstr( const UpnpDiscovery* p_discovery )
-{
- return p_discovery->Location;
-}
-
-static const char* UpnpDiscovery_get_DeviceID_cstr( const UpnpDiscovery* p_discovery )
-{
- return p_discovery->DeviceId;
-}
-
-static IXML_Document* UpnpActionComplete_get_ActionResult( const UpnpActionComplete* p_result )
-{
- return p_result->ActionResult;
-}
-
-static const char* UpnpEvent_get_SID_cstr( const UpnpEvent* p_e )
-{
- return p_e->Sid;
-}
-
-static const char* UpnpEventSubscribe_get_SID_cstr( const UpnpEventSubscribe* p_s )
-{
- return p_s->Sid;
-}
-#else
-typedef const void* UpnpEventPtr;
-#endif
-
/*
* Constants
*/
@@ -118,7 +80,7 @@ vlc_module_end();
/*
* Local prototypes
*/
-static int Callback( Upnp_EventType event_type, UpnpEventPtr p_event, void* p_user_data );
+static int Callback( Upnp_EventType event_type, void* p_event, void* p_user_data );
const char* xml_getChildElementValue( IXML_Element* p_parent,
const char* psz_tag_name );
@@ -363,7 +325,7 @@ int xml_getNumber( IXML_Document* p_doc,
/*
* Handles all UPnP events
*/
-static int Callback( Upnp_EventType event_type, UpnpEventPtr p_event, void* p_user_data )
+static int Callback( Upnp_EventType event_type, void* p_event, void* p_user_data )
{
services_discovery_t* p_sd = ( services_discovery_t* ) p_user_data;
services_discovery_sys_t* p_sys = p_sd->p_sys;
@@ -374,23 +336,22 @@ static int Callback( Upnp_EventType event_type, UpnpEventPtr p_event, void* p_us
case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
case UPNP_DISCOVERY_SEARCH_RESULT:
{
- const UpnpDiscovery* p_discovery = ( const UpnpDiscovery* )p_event;
+ struct Upnp_Discovery* p_discovery = ( struct Upnp_Discovery* )p_event;
IXML_Document *p_description_doc = 0;
int i_res;
- i_res = UpnpDownloadXmlDoc( UpnpDiscovery_get_Location_cstr( p_discovery ), &p_description_doc );
-
+ i_res = UpnpDownloadXmlDoc( p_discovery->Location, &p_description_doc );
if ( i_res != UPNP_E_SUCCESS )
{
msg_Warn( p_sd, "Could not download device description! "
"Fetching data from %s failed: %s",
- UpnpDiscovery_get_Location_cstr( p_discovery ), UpnpGetErrorMessage( i_res ) );
+ p_discovery->Location, UpnpGetErrorMessage( i_res ) );
return i_res;
}
MediaServer::parseDeviceDescription( p_description_doc,
- UpnpDiscovery_get_Location_cstr( p_discovery ), p_sd );
+ p_discovery->Location, p_sd );
ixmlDocument_free( p_description_doc );
}
@@ -398,18 +359,18 @@ static int Callback( Upnp_EventType event_type, UpnpEventPtr p_event, void* p_us
case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
{
- const UpnpDiscovery* p_discovery = ( const UpnpDiscovery* )p_event;
+ struct Upnp_Discovery* p_discovery = ( struct Upnp_Discovery* )p_event;
- p_sys->p_server_list->removeServer( UpnpDiscovery_get_DeviceID_cstr( p_discovery ) );
+ p_sys->p_server_list->removeServer( p_discovery->DeviceId );
}
break;
case UPNP_EVENT_RECEIVED:
{
- const UpnpEvent* p_e = ( const UpnpEvent* )p_event;
+ Upnp_Event* p_e = ( Upnp_Event* )p_event;
- MediaServer* p_server = p_sys->p_server_list->getServerBySID( UpnpEvent_get_SID_cstr( p_e ) );
+ MediaServer* p_server = p_sys->p_server_list->getServerBySID( p_e->Sid );
if ( p_server ) p_server->fetchContents();
}
break;
@@ -419,9 +380,9 @@ static int Callback( Upnp_EventType event_type, UpnpEventPtr p_event, void* p_us
{
/* Re-subscribe. */
- const UpnpEventSubscribe* p_s = ( const UpnpEventSubscribe* )p_event;
+ Upnp_Event_Subscribe* p_s = ( Upnp_Event_Subscribe* )p_event;
- MediaServer* p_server = p_sys->p_server_list->getServerBySID( UpnpEventSubscribe_get_SID_cstr( p_s ) );
+ MediaServer* p_server = p_sys->p_server_list->getServerBySID( p_s->Sid );
if ( p_server ) p_server->subscribeToContentDirectory();
}
break;
--
2.15.1