Source: mplayer Followup-For: Bug #726838 Hi all, I've made some fixes to help package building.
libav-compat.diff: adds system libav compatibility Unfortunately the mplayer code is not enough clean to build using system include so there is a catch. I've removed local ffmpeg from includes (in configure), but some files require libavutil/x86_cpu.h A trick can be add a local patch that adds this file on topdir (this file only). It's not pretty but the alternative is change a lot of files. live555-async.diff: async interface for live555 A patch I've made some time ago that mimic async code (like live555 did) I've noticed some problems in live555 after they removed the sync interface. Applying this patch to an old snapshot of live555 with sync code behaves exactly as using the old live555 code and does not expose the problem(s). control.diff: for new deps libjack-dev -> libjack-dev | libjack-jackd2-dev libmpcdec-dev -> deprecated not enabled by default (decoder in libav?) libschroedinger-dev -> needs ffmpeg static libsvga1-dev -> removed from debian debian/control and debian/rules libsmbclient-dev -> detection is broken, configure needs to use pkg-config (in sid the include is in /usr/include/samba-4.0/libsmbclient.h) libaudio-dev ? nas audio system, really used? libdts-dev -> it's better to use libdca-dev, mplayer uses it anyway the install rule for png files need to be revised, now mplayer has 16 22 24 32 48 256 png Hope it helps Regards -- System Information: Debian Release: jessie/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores) Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash
diff -ur -xdebian mplayer-1.1.1.orig/av_opts.c mplayer-1.1.1/av_opts.c --- mplayer-1.1.1.orig/av_opts.c 2012-01-28 14:51:57.000000000 +0100 +++ mplayer-1.1.1/av_opts.c 2013-12-24 06:49:16.000000000 +0100 @@ -42,7 +42,7 @@ arg = strchr(str, '='); if(arg) *arg++= 0; - if(av_set_string3(v, str, arg, 0, NULL) < 0){ + if (av_opt_set(v, str, arg, 0) < 0) { free(start); return -1; } diff -ur -xdebian mplayer-1.1.1.orig/bstr.c mplayer-1.1.1/bstr.c --- mplayer-1.1.1.orig/bstr.c 2010-07-19 00:00:48.000000000 +0200 +++ mplayer-1.1.1/bstr.c 2013-12-24 06:49:16.000000000 +0100 @@ -18,6 +18,7 @@ #include <string.h> #include <libavutil/avutil.h> +#include <libavutil/common.h> #include "bstr.h" diff -ur -xdebian mplayer-1.1.1.orig/codec-cfg.c mplayer-1.1.1/codec-cfg.c --- mplayer-1.1.1.orig/codec-cfg.c 2012-05-08 12:56:22.000000000 +0200 +++ mplayer-1.1.1/codec-cfg.c 2013-12-24 06:49:16.000000000 +0100 @@ -54,6 +54,7 @@ #include "help_mp.h" #include "libavutil/avutil.h" +#include "libavutil/common.h" #include "libmpcodecs/img_format.h" #include "codec-cfg.h" diff -ur -xdebian mplayer-1.1.1.orig/configure mplayer-1.1.1/configure --- mplayer-1.1.1.orig/configure 2012-05-22 20:01:51.000000000 +0200 +++ mplayer-1.1.1/configure 2013-12-24 06:49:16.000000000 +0100 @@ -1554,7 +1554,7 @@ fi fi -extra_cflags="-I. -Iffmpeg $extra_cflags" +extra_cflags="-I. $extra_cflags" extra_ldflags="-lm $extra_ldflags" _timer=timer-linux.c _getch=getch2.c diff -ur -xdebian mplayer-1.1.1.orig/fmt-conversion.h mplayer-1.1.1/fmt-conversion.h --- mplayer-1.1.1.orig/fmt-conversion.h 2011-03-01 22:44:15.000000000 +0100 +++ mplayer-1.1.1/fmt-conversion.h 2013-12-24 06:49:16.000000000 +0100 @@ -22,6 +22,7 @@ #include "config.h" #include "libavutil/avutil.h" #include "libavutil/samplefmt.h" +#include "libavutil/pixfmt.h" enum PixelFormat imgfmt2pixfmt(int fmt); int pixfmt2imgfmt(enum PixelFormat pix_fmt); diff -ur -xdebian mplayer-1.1.1.orig/libaf/af_format.c mplayer-1.1.1/libaf/af_format.c --- mplayer-1.1.1.orig/libaf/af_format.c 2011-10-26 17:12:35.000000000 +0200 +++ mplayer-1.1.1/libaf/af_format.c 2013-12-24 06:49:16.000000000 +0100 @@ -34,6 +34,7 @@ #include "libvo/fastmemcpy.h" #include "libavutil/avutil.h" +#include "libavutil/common.h" /* Functions used by play to convert the input audio to the correct format */ diff -ur -xdebian mplayer-1.1.1.orig/libaf/af_lavcac3enc.c mplayer-1.1.1/libaf/af_lavcac3enc.c --- mplayer-1.1.1.orig/libaf/af_lavcac3enc.c 2012-02-19 16:21:23.000000000 +0100 +++ mplayer-1.1.1/libaf/af_lavcac3enc.c 2013-12-24 06:49:16.000000000 +0100 @@ -34,6 +34,7 @@ #include "libavcodec/avcodec.h" #include "libavutil/intreadwrite.h" +#include "libavutil/common.h" #define AC3_MAX_CHANNELS 6 #define AC3_FRAME_SIZE 1536 diff -ur -xdebian mplayer-1.1.1.orig/libmpcodecs/vd_ffmpeg.c mplayer-1.1.1/libmpcodecs/vd_ffmpeg.c --- mplayer-1.1.1.orig/libmpcodecs/vd_ffmpeg.c 2012-06-02 17:00:52.000000000 +0200 +++ mplayer-1.1.1/libmpcodecs/vd_ffmpeg.c 2013-12-24 06:49:16.000000000 +0100 @@ -47,6 +47,18 @@ #include "libavcodec/avcodec.h" +#ifndef AV_EF_COMPLIANT +#define AV_EF_COMPLIANT 0 +#endif + +#ifndef AV_EF_CAREFUL +#define AV_EF_CAREFUL 0 +#endif + +#ifndef AV_EF_AGGRESSIVE +#define AV_EF_AGGRESSIVE 0 +#endif + #if AVPALETTE_SIZE > 1024 #error palette too large, adapt libmpcodecs/vf.c:vf_get_image #endif diff -ur -xdebian mplayer-1.1.1.orig/libmpcodecs/vf.c mplayer-1.1.1/libmpcodecs/vf.c --- mplayer-1.1.1.orig/libmpcodecs/vf.c 2012-05-30 23:08:05.000000000 +0200 +++ mplayer-1.1.1/libmpcodecs/vf.c 2013-12-24 06:49:16.000000000 +0100 @@ -41,6 +41,7 @@ #include "libvo/fastmemcpy.h" #include "libavutil/mem.h" +#include "libavutil/common.h" extern const vf_info_t vf_info_1bpp; extern const vf_info_t vf_info_2xsai; diff -ur -xdebian mplayer-1.1.1.orig/libmpcodecs/vf_geq.c mplayer-1.1.1/libmpcodecs/vf_geq.c --- mplayer-1.1.1.orig/libmpcodecs/vf_geq.c 2011-04-19 09:32:36.000000000 +0200 +++ mplayer-1.1.1/libmpcodecs/vf_geq.c 2013-12-24 06:49:16.000000000 +0100 @@ -34,6 +34,7 @@ #include "libavcodec/avcodec.h" #include "libavutil/eval.h" +#include "libavutil/common.h" struct vf_priv_s { AVExpr * e[3]; diff -ur -xdebian mplayer-1.1.1.orig/libmpcodecs/vf_gradfun.c mplayer-1.1.1/libmpcodecs/vf_gradfun.c --- mplayer-1.1.1.orig/libmpcodecs/vf_gradfun.c 2010-04-06 11:46:47.000000000 +0200 +++ mplayer-1.1.1/libmpcodecs/vf_gradfun.c 2013-12-24 06:49:16.000000000 +0100 @@ -39,6 +39,7 @@ #include "vf.h" #include "libvo/fastmemcpy.h" #include "libavutil/avutil.h" +#include "libavutil/common.h" #include "libavutil/x86_cpu.h" struct vf_priv_s { diff -ur -xdebian mplayer-1.1.1.orig/libmpdemux/demux_lavf.c mplayer-1.1.1/libmpdemux/demux_lavf.c --- mplayer-1.1.1.orig/libmpdemux/demux_lavf.c 2012-04-07 22:08:53.000000000 +0200 +++ mplayer-1.1.1/libmpdemux/demux_lavf.c 2013-12-24 06:49:16.000000000 +0100 @@ -439,7 +439,7 @@ type = 'd'; else if(codec->codec_id == CODEC_ID_HDMV_PGS_SUBTITLE) type = 'p'; -#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 14, 100) +#if 0 //LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 14, 100) else if(codec->codec_id == CODEC_ID_EIA_608) type = 'c'; #endif diff -ur -xdebian mplayer-1.1.1.orig/libmpdemux/mp_taglists.c mplayer-1.1.1/libmpdemux/mp_taglists.c --- mplayer-1.1.1.orig/libmpdemux/mp_taglists.c 2012-03-24 20:26:36.000000000 +0100 +++ mplayer-1.1.1/libmpdemux/mp_taglists.c 2013-12-24 06:49:16.000000000 +0100 @@ -23,8 +23,6 @@ #include "mp_taglists.h" #include "libavutil/common.h" #include "libavformat/avformat.h" -// for AVCodecTag -#include "libavformat/internal.h" static const struct AVCodecTag mp_wav_tags[] = { { CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')}, diff -ur -xdebian mplayer-1.1.1.orig/libmpdemux/mp_taglists.h mplayer-1.1.1/libmpdemux/mp_taglists.h --- mplayer-1.1.1.orig/libmpdemux/mp_taglists.h 2011-10-23 14:12:43.000000000 +0200 +++ mplayer-1.1.1/libmpdemux/mp_taglists.h 2013-12-24 06:49:16.000000000 +0100 @@ -20,6 +20,12 @@ #define MPLAYER_MP_TAGLISTS_H #include <stdint.h> +#include "libavformat/avformat.h" + +typedef struct AVCodecTag { + enum CodecID id; + unsigned int tag; +} AVCodecTag; enum CodecID mp_tag2codec_id(uint32_t tag, int audio); uint32_t mp_codec_id2tag(enum CodecID codec_id, uint32_t old_tag, int audio); diff -ur -xdebian mplayer-1.1.1.orig/stream/cache2.c mplayer-1.1.1/stream/cache2.c --- mplayer-1.1.1.orig/stream/cache2.c 2012-03-04 16:11:50.000000000 +0100 +++ mplayer-1.1.1/stream/cache2.c 2013-12-24 06:49:16.000000000 +0100 @@ -40,6 +40,7 @@ #include <errno.h> #include "libavutil/avutil.h" +#include "libavutil/common.h" #include "osdep/shmem.h" #include "osdep/timer.h" #if defined(__MINGW32__) diff -ur -xdebian mplayer-1.1.1.orig/sub/spudec.c mplayer-1.1.1/sub/spudec.c --- mplayer-1.1.1.orig/sub/spudec.c 2012-04-23 20:39:16.000000000 +0200 +++ mplayer-1.1.1/sub/spudec.c 2013-12-24 06:49:16.000000000 +0100 @@ -42,6 +42,7 @@ #include "spudec.h" #include "vobsub.h" #include "libavutil/avutil.h" +#include "libavutil/common.h" #include "libavutil/intreadwrite.h" #include "libswscale/swscale.h" diff -ur -xdebian mplayer-1.1.1.orig/sub/sub_cc.c mplayer-1.1.1/sub/sub_cc.c --- mplayer-1.1.1.orig/sub/sub_cc.c 2012-04-07 22:08:53.000000000 +0200 +++ mplayer-1.1.1/sub/sub_cc.c 2013-12-24 06:49:16.000000000 +0100 @@ -42,6 +42,7 @@ #include "sub.h" #include "libavutil/avutil.h" +#include "libavutil/common.h" #define CC_MAX_LINE_LENGTH 64
diff -ur -xDOCS -xconfig.log -xdebian mplayer-1.1.1.orig/configure mplayer-1.1.1/configure --- mplayer-1.1.1.orig/configure 2013-12-24 06:55:47.500604836 +0100 +++ mplayer-1.1.1/configure 2013-12-24 07:16:17.451587052 +0100 @@ -6667,11 +6667,8 @@ if test "$_live" = auto && test "$networking" = yes ; then cat > $TMPCPP << EOF #include <liveMedia.hh> -#if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600) -#error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/> -#endif #include "BasicUsageEnvironment.hh" -int main(void) { RTSPClient::createNew(*BasicUsageEnvironment::createNew(*BasicTaskScheduler::createNew()), 0, "", 0); return 0; } +int main(void) { RTSPClient::createNew(*BasicUsageEnvironment::createNew(*BasicTaskScheduler::createNew()), "", 0, "", 0); return 0; } EOF _live=no diff -ur -xDOCS -xconfig.log -xdebian mplayer-1.1.1.orig/libmpdemux/demux_rtp.cpp mplayer-1.1.1/libmpdemux/demux_rtp.cpp --- mplayer-1.1.1.orig/libmpdemux/demux_rtp.cpp 2012-03-05 19:14:38.000000000 +0100 +++ mplayer-1.1.1/libmpdemux/demux_rtp.cpp 2013-12-24 07:11:51.591583214 +0100 @@ -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 @@ 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: @@ -126,6 +115,19 @@ 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; @@ -154,13 +156,19 @@ 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, @@ -244,8 +252,12 @@ 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")) @@ -256,7 +268,11 @@ 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 } @@ -645,7 +661,8 @@ 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(); }
--- debian/control.orig 2012-01-12 22:22:22.000000000 +0100 +++ debian/control 2013-12-24 07:20:41.023586764 +0100 @@ -38,24 +38,21 @@ libgif-dev, libgl1-mesa-dev, libgtk2.0-dev, - libjack-dev, + libjack-dev | libjack-jackd2-dev, libjpeg-dev, liblircclient-dev, liblivemedia-dev, liblzo2-dev, libmp3lame-dev, - libmpcdec-dev, libmpeg2-4-dev, libncurses5-dev, libopenal-dev, libpng12-dev | libpng-dev, libpostproc-dev (>= 4:0.8~), libpulse-dev, - libschroedinger-dev, libsdl1.2-dev | libsdl1.1-dev, libsmbclient-dev, libspeex-dev, - libsvga1-dev [i386 amd64], libswscale-dev (>= 4:0.8~), libtheora-dev (>= 1.0~beta1), libvdpau-dev [i386 amd64],