diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-01-02 23:07:23 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-01-02 23:07:23 -0800 |
commit | b6fb3009542576c88973a99d5fb66bf91aa62bb0 (patch) | |
tree | c6b0247ef73b96b4c8e0bee65f93d12e0db1c577 | |
parent | fb01994dbb97148a2c97df4746b3cb52c6034211 (diff) | |
download | xrdp-proprietary-b6fb3009542576c88973a99d5fb66bf91aa62bb0.tar.gz xrdp-proprietary-b6fb3009542576c88973a99d5fb66bf91aa62bb0.zip |
xrdpvr: compile fix for older ffmpeg
-rw-r--r-- | xrdpvr/xrdpvr.c | 7 | ||||
-rw-r--r-- | xrdpvr/xrdpvr_internal.h | 22 |
2 files changed, 25 insertions, 4 deletions
diff --git a/xrdpvr/xrdpvr.c b/xrdpvr/xrdpvr.c index b30869a8..8a63dbed 100644 --- a/xrdpvr/xrdpvr.c +++ b/xrdpvr/xrdpvr.c @@ -162,13 +162,13 @@ xrdpvr_play_media(void *channel, int stream_id, char *filename) /* find first audio / video stream */ for (i = 0; i < g_psi.p_format_ctx->nb_streams; i++) { - if (g_psi.p_format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO && + if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO && g_video_index < 0) { g_video_index = i; } - if (g_psi.p_format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO && + if (g_psi.p_format_ctx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO && g_audio_index < 0) { g_audio_index = i; @@ -342,7 +342,7 @@ int xrdpvr_play_frame(void *channel, int stream_id, int *videoTimeout, int *audi *audioTimeout = (int) ((dts - g_psi.audioTimeout) * 1000000); *videoTimeout = -1; - if (g_psi.audioTimeout > dts) + if (g_psi.audioTimeout > dts) { g_psi.audioTimeout = dts; delay_in_us = 1000 * 40; @@ -728,4 +728,3 @@ xrdpvr_write_to_client(void *channel, STREAM *s) usleep(1000 * 3); } } - diff --git a/xrdpvr/xrdpvr_internal.h b/xrdpvr/xrdpvr_internal.h index ca15caf1..29160d46 100644 --- a/xrdpvr/xrdpvr_internal.h +++ b/xrdpvr/xrdpvr_internal.h @@ -26,8 +26,30 @@ #include <stdint.h> #include <sys/types.h> #include <fcntl.h> +#include <libavcodec/avcodec.h> #include <libavformat/avformat.h> +#if LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR == 20 +#define DISTRO_DEBIAN6 +#endif + +#if LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR == 72 +#define DISTRO_UBUNTU1104 +#endif + +#if LIBAVCODEC_VERSION_MAJOR == 53 && LIBAVCODEC_VERSION_MINOR == 35 +#define DISTRO_UBUNTU1204 +#endif + +#if !defined(DISTRO_DEBIAN6) && !defined(DISTRO_UBUNTU1104) && !defined(DISTRO_UBUNTU1204) +#warning unsupported distro +#endif + +#ifdef DISTRO_UBUNTU1204 +#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO +#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO +#endif + #define MAX_BUFSIZE (1024 * 1024 * 8) #define CMD_SET_VIDEO_FORMAT 1 |