[SCM] vlc/master: Support for libupnp 1.8

sramacher at users.alioth.debian.org sramacher at users.alioth.debian.org
Wed Aug 30 18:54:57 UTC 2017


The following commit has been merged in the master branch:
commit 28cbff064a3c842f3cfa85705ddd5df228c76f36
Author: Sebastian Ramacher <sramacher at debian.org>
Date:   Wed Aug 30 20:53:29 2017 +0200

    Support for libupnp 1.8

diff --git a/debian/patches/0013-codec-flac-fix-heap-write-overflow-on-frame-format-c.patch b/debian/patches/0013-codec-flac-fix-heap-write-overflow-on-frame-format-c.patch
index 253a3f0..9e817cf 100644
--- a/debian/patches/0013-codec-flac-fix-heap-write-overflow-on-frame-format-c.patch
+++ b/debian/patches/0013-codec-flac-fix-heap-write-overflow-on-frame-format-c.patch
@@ -40,10 +40,11 @@ index 8ab1cb4..8cb1222 100644
  /*****************************************************************************
   * Local prototypes
   *****************************************************************************/
-@@ -143,6 +158,29 @@ static void Interleave( int32_t *p_out, const int32_t * const *pp_in,
+@@ -142,6 +157,29 @@ static void Interleave( int32_t *p_out, const int32_t * const *pp_in,
+         }
  }
  
- /*****************************************************************************
++/*****************************************************************************
 + * DecoderSetOutputFormat: helper function to convert and check frame format
 + *****************************************************************************/
 +static int DecoderSetOutputFormat( unsigned i_channels, unsigned i_rate,
@@ -66,10 +67,9 @@ index 8ab1cb4..8cb1222 100644
 +    return VLC_SUCCESS;
 +}
 +
-+/*****************************************************************************
+ /*****************************************************************************
   * DecoderWriteCallback: called by libflac to output decoded samples
   *****************************************************************************/
- static FLAC__StreamDecoderWriteStatus
 @@ -150,30 +188,31 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
                        const FLAC__Frame *frame,
                        const FLAC__int32 *const buffer[], void *client_data )
diff --git a/debian/patches/0014-upnp-Add-support-for-libupnp-1.8.patch b/debian/patches/0014-upnp-Add-support-for-libupnp-1.8.patch
new file mode 100644
index 0000000..1bdd10a
--- /dev/null
+++ b/debian/patches/0014-upnp-Add-support-for-libupnp-1.8.patch
@@ -0,0 +1,144 @@
+From: Sebastian Ramacher <sebastian at ramacher.at>
+Date: Wed, 30 Aug 2017 18:31:34 +0200
+Subject: upnp: Add support for libupnp 1.8
+
+Callbacks now take const void* as second argument and some members can
+only be accessed via getter functions.
+
+Signed-off-by: Sebastian Ramacher <sramacher at debian.org>
+Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
+(cherry picked from commit 3eb4e03512f45c1fa27c7f9a6759e8e7d3905720)
+---
+ modules/services_discovery/upnp.cpp | 63 ++++++++++++++++++++++++++++++-------
+ 1 file changed, 51 insertions(+), 12 deletions(-)
+
+diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
+index 4642ff9..ab61c5c 100644
+--- a/modules/services_discovery/upnp.cpp
++++ b/modules/services_discovery/upnp.cpp
+@@ -40,6 +40,44 @@
+ #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
+ */
+@@ -80,7 +118,7 @@ vlc_module_end();
+ /*
+  * Local prototypes
+  */
+-static int Callback( Upnp_EventType event_type, void* p_event, void* p_user_data );
++static int Callback( Upnp_EventType event_type, UpnpEventPtr p_event, void* p_user_data );
+ 
+ const char* xml_getChildElementValue( IXML_Element* p_parent,
+                                       const char*   psz_tag_name );
+@@ -325,7 +363,7 @@ int xml_getNumber( IXML_Document* p_doc,
+ /*
+  * Handles all UPnP events
+  */
+-static int Callback( Upnp_EventType event_type, void* p_event, void* p_user_data )
++static int Callback( Upnp_EventType event_type, UpnpEventPtr 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;
+@@ -336,22 +374,23 @@ static int Callback( Upnp_EventType event_type, void* p_event, void* p_user_data
+     case UPNP_DISCOVERY_ADVERTISEMENT_ALIVE:
+     case UPNP_DISCOVERY_SEARCH_RESULT:
+     {
+-        struct Upnp_Discovery* p_discovery = ( struct Upnp_Discovery* )p_event;
++        const UpnpDiscovery* p_discovery = ( const UpnpDiscovery* )p_event;
+ 
+         IXML_Document *p_description_doc = 0;
+ 
+         int i_res;
+-        i_res = UpnpDownloadXmlDoc( p_discovery->Location, &p_description_doc );
++        i_res = UpnpDownloadXmlDoc( UpnpDiscovery_get_Location_cstr( p_discovery ), &p_description_doc );
++
+         if ( i_res != UPNP_E_SUCCESS )
+         {
+             msg_Warn( p_sd, "Could not download device description! "
+                             "Fetching data from %s failed: %s",
+-                            p_discovery->Location, UpnpGetErrorMessage( i_res ) );
++                            UpnpDiscovery_get_Location_cstr( p_discovery ), UpnpGetErrorMessage( i_res ) );
+             return i_res;
+         }
+ 
+         MediaServer::parseDeviceDescription( p_description_doc,
+-                p_discovery->Location, p_sd );
++                UpnpDiscovery_get_Location_cstr( p_discovery ), p_sd );
+ 
+         ixmlDocument_free( p_description_doc );
+     }
+@@ -359,18 +398,18 @@ static int Callback( Upnp_EventType event_type, void* p_event, void* p_user_data
+ 
+     case UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE:
+     {
+-        struct Upnp_Discovery* p_discovery = ( struct Upnp_Discovery* )p_event;
++        const UpnpDiscovery* p_discovery = ( const UpnpDiscovery* )p_event;
+ 
+-        p_sys->p_server_list->removeServer( p_discovery->DeviceId );
++        p_sys->p_server_list->removeServer( UpnpDiscovery_get_DeviceID_cstr( p_discovery ) );
+ 
+     }
+     break;
+ 
+     case UPNP_EVENT_RECEIVED:
+     {
+-        Upnp_Event* p_e = ( Upnp_Event* )p_event;
++        const UpnpEvent* p_e = ( const UpnpEvent* )p_event;
+ 
+-        MediaServer* p_server = p_sys->p_server_list->getServerBySID( p_e->Sid );
++        MediaServer* p_server = p_sys->p_server_list->getServerBySID( UpnpEvent_get_SID_cstr( p_e ) );
+         if ( p_server ) p_server->fetchContents();
+     }
+     break;
+@@ -380,9 +419,9 @@ static int Callback( Upnp_EventType event_type, void* p_event, void* p_user_data
+     {
+         /* Re-subscribe. */
+ 
+-        Upnp_Event_Subscribe* p_s = ( Upnp_Event_Subscribe* )p_event;
++        const UpnpEventSubscribe* p_s = ( const UpnpEventSubscribe* )p_event;
+ 
+-        MediaServer* p_server = p_sys->p_server_list->getServerBySID( p_s->Sid );
++        MediaServer* p_server = p_sys->p_server_list->getServerBySID( UpnpEventSubscribe_get_SID_cstr( p_s ) );
+         if ( p_server ) p_server->subscribeToContentDirectory();
+     }
+     break;
diff --git a/debian/patches/series b/debian/patches/series
index 8733a55..21de7e1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@
 0011-codec-avcodec-check-avcodec-visible-sizes.patch
 0012-decoder-check-visible-size-when-creating-buffer.patch
 0013-codec-flac-fix-heap-write-overflow-on-frame-format-c.patch
+0014-upnp-Add-support-for-libupnp-1.8.patch

-- 
VLC media player packaging



More information about the pkg-multimedia-commits mailing list