mplayer: add patch to fix building with modern versions of live555
authorPeter Korsgaard <peter@korsgaard.com>
Mon, 13 Jan 2014 21:08:46 +0000 (22:08 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 13 Jan 2014 21:08:46 +0000 (22:08 +0100)
Patch taken from: https://raw.github.com/sherpya/mplayer-be/master/patches/mp/0025-mpdemux-live555-async-interface.patch

At the same time rename patches to follow the new convention.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/mplayer/mplayer-0001-disable-install-strip.patch [new file with mode: 0644]
package/mplayer/mplayer-0002-fix-cc-parsing.patch [new file with mode: 0644]
package/mplayer/mplayer-0003-mpdemux-live555-async-interface.patch [new file with mode: 0644]
package/mplayer/mplayer-1.1-disable-install-strip.patch [deleted file]
package/mplayer/mplayer-1.1-fix-cc-parsing.patch [deleted file]

diff --git a/package/mplayer/mplayer-0001-disable-install-strip.patch b/package/mplayer/mplayer-0001-disable-install-strip.patch
new file mode 100644 (file)
index 0000000..644d292
--- /dev/null
@@ -0,0 +1,24 @@
+Disable stripping on installation
+
+Using the -s option of install does not work, as it uses the host
+strip instead of the cross strip. So, get rid of it, and let Buildroot
+handle the stripping.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ configure |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: mplayer-32710/configure
+===================================================================
+--- mplayer-32710.orig/configure
++++ mplayer-32710/configure
+@@ -2519,7 +2519,7 @@
+ # Checking for CFLAGS
+-_install_strip="-s"
++_install_strip=
+ if test "$_profile" != "" || test "$_debug" != "" ; then
+   CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
+   WARNFLAGS="-W -Wall"
diff --git a/package/mplayer/mplayer-0002-fix-cc-parsing.patch b/package/mplayer/mplayer-0002-fix-cc-parsing.patch
new file mode 100644 (file)
index 0000000..a3ba03f
--- /dev/null
@@ -0,0 +1,22 @@
+[PATCH] mplayer: fix --cc= parsing if the value contains equal signs (=)
+
+E.G. if -cc="$CROSS-gcc --sysroot=<SYSROOT>" is passed.
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+---
+ configure |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: mplayer-32710/configure
+===================================================================
+--- mplayer-32710.orig/configure
++++ mplayer-32710/configure
+@@ -870,7 +870,7 @@
+     _target=$(echo $ac_option | cut -d '=' -f 2)
+     ;;
+   --cc=*)
+-    _cc=$(echo $ac_option | cut -d '=' -f 2)
++    _cc=$(echo $ac_option | cut -d '=' -f 2-)
+     ;;
+   --host-cc=*)
+     _host_cc=$(echo $ac_option | cut -d '=' -f 2)
diff --git a/package/mplayer/mplayer-0003-mpdemux-live555-async-interface.patch b/package/mplayer/mplayer-0003-mpdemux-live555-async-interface.patch
new file mode 100644 (file)
index 0000000..5a62a18
--- /dev/null
@@ -0,0 +1,126 @@
+From d3195ea13f4a9aae546ff996e53681349a1a3cdb Mon Sep 17 00:00:00 2001
+From: sherpya <sherpya@netfarm.it>
+Date: Fri, 14 Jun 2013 05:25:38 +0200
+Subject: [PATCH 25/27] mpdemux: live555 async interface
+
+From: https://raw.github.com/sherpya/mplayer-be/master/patches/mp/0025-mpdemux-live555-async-interface.patch
+
+Adjust live555 interface code for modern versions of live555.
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ libmpdemux/demux_rtp.cpp | 51 ++++++++++++++++++++++++++++++++----------------
+ 2 files changed, 35 insertions(+), 22 deletions(-)
+
+diff --git a/libmpdemux/demux_rtp.cpp b/libmpdemux/demux_rtp.cpp
+index ad7a7f1..05d06e0 100644
+--- a/libmpdemux/demux_rtp.cpp
++++ b/libmpdemux/demux_rtp.cpp
+@@ -19,8 +19,6 @@
+  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+  */
+-#define RTSPCLIENT_SYNCHRONOUS_INTERFACE 1
+-
+ extern "C" {
+ // on MinGW, we must include windows.h before the things it conflicts
+ #ifdef __MINGW32__    // with.  they are each protected from
+@@ -94,15 +92,6 @@ struct RTPState {
+ extern "C" char* network_username;
+ extern "C" char* network_password;
+-static char* openURL_rtsp(RTSPClient* client, char const* url) {
+-  // If we were given a user name (and optional password), then use them:
+-  if (network_username != NULL) {
+-    char const* password = network_password == NULL ? "" : network_password;
+-    return client->describeWithPassword(url, network_username, password);
+-  } else {
+-    return client->describeURL(url);
+-  }
+-}
+ static char* openURL_sip(SIPClient* client, char const* url) {
+   // If we were given a user name (and optional password), then use them:
+@@ -118,6 +107,19 @@ static char* openURL_sip(SIPClient* client, char const* url) {
+ extern AVCodecContext *avcctx;
+ #endif
++static char fWatchVariableForSyncInterface;
++static char* fResultString;
++static int fResultCode;
++
++static void responseHandlerForSyncInterface(RTSPClient* rtspClient, int responseCode, char* responseString) {
++  // Set result values:
++  fResultCode = responseCode;
++  fResultString = responseString;
++
++  // Signal a break from the event loop (thereby returning from the blocking command):
++  fWatchVariableForSyncInterface = ~0;
++}
++
+ extern "C" int audio_id, video_id, dvdsub_id;
+ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+   Boolean success = False;
+@@ -146,13 +148,19 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+         rtsp_transport_http = demuxer->stream->streaming_ctrl->url->port;
+         rtsp_transport_tcp = 1;
+       }
+-      rtspClient = RTSPClient::createNew(*env, verbose, "MPlayer", rtsp_transport_http);
++      rtspClient = RTSPClient::createNew(*env, url, verbose, "MPlayer", rtsp_transport_http);
+       if (rtspClient == NULL) {
+         fprintf(stderr, "Failed to create RTSP client: %s\n",
+                 env->getResultMsg());
+         break;
+       }
+-      sdpDescription = openURL_rtsp(rtspClient, url);
++      fWatchVariableForSyncInterface = 0;
++      rtspClient->sendDescribeCommand(responseHandlerForSyncInterface);
++      env->taskScheduler().doEventLoop(&fWatchVariableForSyncInterface);
++      if (fResultCode == 0)
++          sdpDescription = fResultString;
++      else
++          delete[] fResultString;
+       } else { // SIP
+       unsigned char desiredAudioType = 0; // PCMU (use 3 for GSM)
+       sipClient = SIPClient::createNew(*env, desiredAudioType, NULL,
+@@ -236,8 +244,12 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+       if (rtspClient != NULL) {
+         // Issue a RTSP "SETUP" command on the chosen subsession:
+-        if (!rtspClient->setupMediaSubsession(*subsession, False,
+-                                              rtsp_transport_tcp)) break;
++        fWatchVariableForSyncInterface = 0;
++        rtspClient->sendSetupCommand(*subsession, responseHandlerForSyncInterface, False, rtsp_transport_tcp);
++        env->taskScheduler().doEventLoop(&fWatchVariableForSyncInterface);
++        delete[] fResultString;
++        if (fResultCode != 0) break;
++
+         if (!strcmp(subsession->mediumName(), "audio"))
+           audiofound = 1;
+         if (!strcmp(subsession->mediumName(), "video"))
+@@ -248,7 +260,11 @@ extern "C" demuxer_t* demux_open_rtp(demuxer_t* demuxer) {
+     if (rtspClient != NULL) {
+       // Issue a RTSP aggregate "PLAY" command on the whole session:
+-      if (!rtspClient->playMediaSession(*mediaSession)) break;
++      fWatchVariableForSyncInterface = 0;
++      rtspClient->sendPlayCommand(*mediaSession, responseHandlerForSyncInterface);
++      env->taskScheduler().doEventLoop(&fWatchVariableForSyncInterface);
++      delete[] fResultString;
++      if (fResultCode != 0) break;
+     } else if (sipClient != NULL) {
+       sipClient->sendACK(); // to start the stream flowing
+     }
+@@ -637,7 +653,8 @@ static void teardownRTSPorSIPSession(RTPState* rtpState) {
+   MediaSession* mediaSession = rtpState->mediaSession;
+   if (mediaSession == NULL) return;
+   if (rtpState->rtspClient != NULL) {
+-    rtpState->rtspClient->teardownMediaSession(*mediaSession);
++    fWatchVariableForSyncInterface = 0;
++    rtpState->rtspClient->sendTeardownCommand(*mediaSession, NULL);
+   } else if (rtpState->sipClient != NULL) {
+     rtpState->sipClient->sendBYE();
+   }
+-- 
+1.8.5.2
+
diff --git a/package/mplayer/mplayer-1.1-disable-install-strip.patch b/package/mplayer/mplayer-1.1-disable-install-strip.patch
deleted file mode 100644 (file)
index 644d292..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-Disable stripping on installation
-
-Using the -s option of install does not work, as it uses the host
-strip instead of the cross strip. So, get rid of it, and let Buildroot
-handle the stripping.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- configure |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: mplayer-32710/configure
-===================================================================
---- mplayer-32710.orig/configure
-+++ mplayer-32710/configure
-@@ -2519,7 +2519,7 @@
- # Checking for CFLAGS
--_install_strip="-s"
-+_install_strip=
- if test "$_profile" != "" || test "$_debug" != "" ; then
-   CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
-   WARNFLAGS="-W -Wall"
diff --git a/package/mplayer/mplayer-1.1-fix-cc-parsing.patch b/package/mplayer/mplayer-1.1-fix-cc-parsing.patch
deleted file mode 100644 (file)
index a3ba03f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-[PATCH] mplayer: fix --cc= parsing if the value contains equal signs (=)
-
-E.G. if -cc="$CROSS-gcc --sysroot=<SYSROOT>" is passed.
-
-Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
----
- configure |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: mplayer-32710/configure
-===================================================================
---- mplayer-32710.orig/configure
-+++ mplayer-32710/configure
-@@ -870,7 +870,7 @@
-     _target=$(echo $ac_option | cut -d '=' -f 2)
-     ;;
-   --cc=*)
--    _cc=$(echo $ac_option | cut -d '=' -f 2)
-+    _cc=$(echo $ac_option | cut -d '=' -f 2-)
-     ;;
-   --host-cc=*)
-     _host_cc=$(echo $ac_option | cut -d '=' -f 2)