From 449f58f2a34b910d194e62ba37a781a0ebc71f942a001b9dc25668c4c59a64a9 Mon Sep 17 00:00:00 2001 From: Dave Plater Date: Tue, 13 Aug 2024 08:33:01 +0000 Subject: [PATCH] Add ffmpeg-7 compat changes OBS-URL: https://build.opensuse.org/package/show/multimedia:xine/xine-lib?expand=0&rev=153 --- .gitattributes | 23 + .gitignore | 1 + baselibs.conf | 1 + xine-lib-1.2.13.tar.xz | 3 + xine-lib-configure-c99.patch | 116 ++++ xine-lib-ffmpeg-7.patch | 1098 ++++++++++++++++++++++++++++++++++ xine-lib-libdvdread_udf.diff | 122 ++++ xine-lib-theora.patch | 13 + xine-lib-v4l-2.6.38.patch | 26 + xine-lib.changes | 607 +++++++++++++++++++ xine-lib.spec | 749 +++++++++++++++++++++++ 11 files changed, 2759 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 baselibs.conf create mode 100644 xine-lib-1.2.13.tar.xz create mode 100644 xine-lib-configure-c99.patch create mode 100644 xine-lib-ffmpeg-7.patch create mode 100644 xine-lib-libdvdread_udf.diff create mode 100644 xine-lib-theora.patch create mode 100644 xine-lib-v4l-2.6.38.patch create mode 100644 xine-lib.changes create mode 100644 xine-lib.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..b583a14 --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libxine2 diff --git a/xine-lib-1.2.13.tar.xz b/xine-lib-1.2.13.tar.xz new file mode 100644 index 0000000..778cbf8 --- /dev/null +++ b/xine-lib-1.2.13.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3def43d3c0597f0f23cbf73e9d4b1dcd328852f2100fcff89fe925ad7cdd0251 +size 5004148 diff --git a/xine-lib-configure-c99.patch b/xine-lib-configure-c99.patch new file mode 100644 index 0000000..2fe8173 --- /dev/null +++ b/xine-lib-configure-c99.patch @@ -0,0 +1,116 @@ +configure: Add fake prototypes for C99 compatibility + +The xxmc-related configure probes assume that the compiler +supports implicit function declarations because it tries to +call the functions without including the appropriate headers, +for link testing. + +As the headers are not determined yet at this point, use +a fake prototype (the same that autoconf uses) to avoid +the implicit function declarations. + +This avoids altering the outcome of these checks with future +compilers which do not support implicit function declarations. + +Submitted upstream: + + + +diff --git a/configure b/configure +index a4009e857777b5cf..3a83b40efda8fd5d 100755 +--- a/configure ++++ b/configure +@@ -28563,7 +28563,7 @@ $as_echo "" >&6; } + LIBS="$XXMC_LIBS $X_LIBS $XV_LIBS $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++char XvMCPutSlice(void); + int + main () + { +@@ -28578,7 +28578,7 @@ else + LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS $DYNAMIC_LD_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++char XvMCPutSlice(void); + int + main () + { +@@ -28616,7 +28616,7 @@ done + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++char XvMCCreateContext(void); + int + main () + { +@@ -28631,7 +28631,7 @@ else + LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++char XvMCCreateContext(void); + int + main () + { +@@ -28675,7 +28675,7 @@ $as_echo "" >&6; } + LIBS="$XVMC_LIBS $X_LIBS $XV_LIBS $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++char XvMCCreateContext(void); + int + main () + { +@@ -28690,7 +28690,7 @@ else + LIBS="$XVMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS $DYNAMIC_LD_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++char XvMCCreateContext(void); + int + main () + { +diff --git a/m4/video_out.m4 b/m4/video_out.m4 +index 150b477697297c03..8aa1f4a3b9267ff9 100644 +--- a/m4/video_out.m4 ++++ b/m4/video_out.m4 +@@ -496,9 +496,9 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ + AC_MSG_CHECKING([whether to enable the xxmc plugin with VLD extensions]) + AC_MSG_RESULT([]) + LIBS="$XXMC_LIBS $X_LIBS $XV_LIBS $LIBS" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCPutSlice()]])], [have_xxmc=yes], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[char XvMCPutSlice(void);]], [[XvMCPutSlice()]])], [have_xxmc=yes], + [LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS $DYNAMIC_LD_LIBS" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCPutSlice()]])], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[char XvMCPutSlice(void);]], [[XvMCPutSlice()]])], + [have_xxmc=yes XXMC_LIBS="$XXMC_LIBS -lXvMC"])]) + if test x"$have_xxmc" = x"yes"; then + AC_CHECK_HEADERS([X11/extensions/vldXvMC.h], +@@ -506,9 +506,9 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ + AC_DEFINE([HAVE_VLDXVMC], 1, [Define if you have vldXvMC.h])], + [have_vldexts=no]) + else +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], [have_xxmc=yes], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[char XvMCCreateContext(void);]], [[XvMCCreateContext()]])], [have_xxmc=yes], + [LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[char XvMCCreateContext(void);]], [[XvMCCreateContext()]])], + [have_xxmc=yes XXMC_LIBS="$XXMC_LIBS -lXvMC"])]) + fi + if test x"$have_xxmc" = x"yes"; then +@@ -521,9 +521,9 @@ AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [ + AC_MSG_CHECKING([whether to enable the xvmc plugin]) + AC_MSG_RESULT([]) + LIBS="$XVMC_LIBS $X_LIBS $XV_LIBS $LIBS" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], [have_xvmc=yes], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[char XvMCCreateContext(void);]], [[XvMCCreateContext()]])], [have_xvmc=yes], + [LIBS="$XVMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS $DYNAMIC_LD_LIBS" +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[char XvMCCreateContext(void);]], [[XvMCCreateContext()]])], + [have_xvmc=yes XVMC_LIBS="$XVMC_LIBS -lXvMC"])]) + if test x"$have_xvmc" = x"yes"; then + AC_CHECK_HEADERS([X11/extensions/XvMC.h], [], [have_xvmc=no]) diff --git a/xine-lib-ffmpeg-7.patch b/xine-lib-ffmpeg-7.patch new file mode 100644 index 0000000..69ad83c --- /dev/null +++ b/xine-lib-ffmpeg-7.patch @@ -0,0 +1,1098 @@ +Cumulative patches from upstream: +https://sourceforge.net/p/xine/xine-lib-1.2/ci/73b833e7fe35 +https://sourceforge.net/p/xine/xine-lib-1.2/ci/1e7b18400886 +https://sourceforge.net/p/xine/xine-lib-1.2/ci/0a786d63bbdb +https://sourceforge.net/p/xine/xine-lib-1.2/ci/6f1000084f60 +https://sourceforge.net/p/xine/xine-lib-1.2/ci/771f4ae27e58 + +diff --git a/src/combined/ffmpeg/demux_avformat.c b/src/combined/ffmpeg/demux_avformat.c +index 30b6a2d..a3c2cae 100644 +--- a/src/combined/ffmpeg/demux_avformat.c ++++ b/src/combined/ffmpeg/demux_avformat.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2013-2022 the xine project ++ * Copyright (C) 2013-2023 the xine project + * Copyright (C) 2013-2020 Petri Hintukainen + * + * This file is part of xine, a free video player. +@@ -423,8 +423,13 @@ static int find_avformat_streams(avformat_demux_plugin_t *this) { + } + + #ifdef XFF_CODECPAR ++# if XFF_AUDIO_CHANNEL_LAYOUT < 2 + if (st->codecpar && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && + st->codecpar->sample_rate != 0 && st->codecpar->channels != 0) ++# else ++ if (st->codecpar && st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && ++ st->codecpar->sample_rate != 0 && st->codecpar->ch_layout.nb_channels != 0) ++# endif + #else + if (st->codec && st->codec->codec_type == AVMEDIA_TYPE_AUDIO && + st->codec->sample_rate != 0 && st->codec->channels != 0) +@@ -501,7 +506,11 @@ static void send_headers_audio(avformat_demux_plugin_t *this) { + buf->size = extradata_size + sizeof(xine_waveformatex); + buf->decoder_info[1] = ctx->sample_rate; + buf->decoder_info[2] = ctx->bits_per_coded_sample; ++#if XFF_AUDIO_CHANNEL_LAYOUT < 2 + buf->decoder_info[3] = ctx->channels; ++#else ++ buf->decoder_info[3] = ctx->ch_layout.nb_channels; ++#endif + buf->decoder_flags = BUF_FLAG_HEADER | BUF_FLAG_STDHEADER | BUF_FLAG_FRAME_END; + + this->stream->audio_fifo->put (this->stream->audio_fifo, buf); +diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c +index b542b85..cec1ce6 100644 +--- a/src/combined/ffmpeg/ff_audio_decoder.c ++++ b/src/combined/ffmpeg/ff_audio_decoder.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2001-2022 the xine project ++ * Copyright (C) 2001-2024 the xine project + * + * This file is part of xine, a free video player. + * +@@ -67,6 +67,7 @@ typedef struct { + + xine_t *xine; + float gain; ++ int bitexact; + } ff_audio_class_t; + + typedef struct ff_audio_decoder_s { +@@ -188,14 +189,25 @@ static int ff_aac_mode_parse (ff_audio_decoder_t *this, uint8_t *buf, int size, + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + "ffmpeg_audio_dec: found AAC ADTS syncword after %d bytes\n", i); + if (this->buftype == BUF_AUDIO_AAC_LATM) { ++ uint8_t *ed = NULL; ++ int es = 0; + xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, + "ffmpeg_audio_dec: stream says LATM but is ADTS -> switching decoders\n"); +- if (this->decoder_ok) { +- pthread_mutex_lock (&ffmpeg_lock); +- avcodec_close (this->context); +- pthread_mutex_unlock (&ffmpeg_lock); +- this->decoder_ok = 0; ++ pthread_mutex_lock (&ffmpeg_lock); ++ if (this->context) { ++ ed = this->context->extradata; ++ es = this->context->extradata_size; ++ this->context->extradata = NULL; ++ this->context->extradata_size = 0; ++ XFF_FREE_CONTEXT (this->context); + } ++ this->decoder_ok = 0; ++ this->context = XFF_ALLOC_CONTEXT (); ++ if (this->context) { ++ this->context->extradata = ed; ++ this->context->extradata_size = es; ++ } ++ pthread_mutex_unlock (&ffmpeg_lock); + this->codec = NULL; + ff_audio_open_codec (this, BUF_AUDIO_AAC); + } +@@ -303,7 +315,11 @@ static void ff_audio_init_codec(ff_audio_decoder_t *this, unsigned int codec_typ + + this->context->bits_per_sample = this->ff_bits; + this->context->sample_rate = this->ff_sample_rate; ++#if XFF_AUDIO_CHANNEL_LAYOUT < 2 + this->context->channels = this->ff_channels; ++#else ++ this->context->ch_layout.nb_channels = this->ff_channels; ++#endif + this->context->codec_id = this->codec->id; + this->context->codec_type = this->codec->type; + this->context->codec_tag = _x_stream_info_get(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC); +@@ -345,6 +361,11 @@ static int ff_audio_open_codec(ff_audio_decoder_t *this, unsigned int codec_type + return -1; + } + ++ if (this->class->bitexact) ++ this->context->flags |= CODEC_FLAG_BITEXACT; ++ else ++ this->context->flags &= ~CODEC_FLAG_BITEXACT; ++ + pthread_mutex_lock (&ffmpeg_lock); + if (XFF_AVCODEC_OPEN (this->context, this->codec) < 0) { + pthread_mutex_unlock (&ffmpeg_lock); +@@ -527,16 +548,75 @@ static void ff_audio_output_close(ff_audio_decoder_t *this) + this->ao_mode = 0; + } + ++static unsigned int ff_list_channels (uint8_t *list, uint64_t map) { ++ unsigned int n, bit; ++ ++ for (n = bit = 0; map; map >>= 1, bit++) { ++ uint32_t b = map & 1; ++ ++ list[n] = bit; ++ n += b; ++ } ++ return n; ++} ++ + static void ff_map_channels (ff_audio_decoder_t *this) { + uint64_t ff_map; ++ uint8_t ff_list[64]; ++ unsigned int ff_num; ++ const char *type = "native"; + int caps = this->stream->audio_out->get_capabilities (this->stream->audio_out); + ++#if XFF_AUDIO_CHANNEL_LAYOUT < 2 ++ + /* safety kludge for very old libavcodec */ +-#ifdef AV_CH_FRONT_LEFT ++# ifdef AV_CH_FRONT_LEFT + ff_map = this->context->channel_layout; + if (!ff_map) /* wma2 bug */ +-#endif ++# endif + ff_map = ((uint64_t)1 << this->context->channels) - 1; ++ ff_num = ff_list_channels (ff_list, ff_map); ++ ++#else /* XFF_AUDIO_CHANNEL_LAYOUT == 2 */ ++ ++ ff_num = this->context->ch_layout.nb_channels; ++ if (ff_num > (int)(sizeof (ff_list) / sizeof (ff_list[0]))) ++ ff_num = sizeof (ff_list) / sizeof (ff_list[0]); ++ switch (this->context->ch_layout.order) { ++ const AVChannelCustom *cmap; ++ unsigned int i; ++ ++ case AV_CHANNEL_ORDER_UNSPEC: ++ type = "unknown"; ++ goto _fallback; ++ ++ case AV_CHANNEL_ORDER_NATIVE: ++ ff_map = this->context->ch_layout.u.mask; ++ if (!ff_map) /* wma2 bug */ ++ ff_map = ((uint64_t)1 << ff_num) - 1; ++ ff_num = ff_list_channels (ff_list, ff_map); ++ break; ++ ++ case AV_CHANNEL_ORDER_CUSTOM: ++ type = "custom"; ++ if (!(cmap = this->context->ch_layout.u.map)) ++ goto _fallback; ++ ff_map = 0; ++ for (i = 0; i < ff_num; i++) { ++ ff_list[i] = cmap[i].id; ++ ff_map |= (uint64_t)1 << ff_list[i]; ++ } ++ break; ++ ++ default: ++ type = "unsupported"; ++ /* fall through */ ++ _fallback: ++ ff_map = ((uint64_t)1 << ff_num) - 1; ++ ff_num = ff_list_channels (ff_list, ff_map); ++ } ++ ++#endif + + if ((caps != this->ao_caps) || (ff_map != this->ff_map)) { + unsigned int i, j; +@@ -562,7 +642,7 @@ static void ff_map_channels (ff_audio_decoder_t *this) { + + this->ao_caps = caps; + this->ff_map = ff_map; +- this->ff_channels = this->context->channels; ++ this->ff_channels = ff_num; + + /* silence out */ + for (i = 0; i < MAX_CHANNELS; i++) +@@ -576,20 +656,23 @@ static void ff_map_channels (ff_audio_decoder_t *this) { + this->left[0] = this->right[0] = 0; + tries = wishlist + 0 * num_modes; + } else if (this->ff_channels == 2) { /* stereo */ ++ /* FIXME: libxine does not yet support audio selection _after_ decoding. ++ * For now, treat the most common "dual mono" case as stereo. */ + name_map[0] = 0; + name_map[1] = 1; + this->left[0] = 0; + this->right[0] = 1; + tries = wishlist + 1 * num_modes; + } else { +- for (i = j = 0; i < sizeof (base_map) / sizeof (base_map[0]); i++) { +- if ((ff_map >> i) & 1) { +- int8_t target = base_map[i]; +- if ((target >= 0) && (this->map[target] < 0)) +- this->map[target] = j; +- name_map[j] = i; /* for debug output below */ +- j++; +- } ++ for (i = 0; i < ff_num; i++) { ++ int8_t target; ++ uint32_t num = ff_list[i]; ++ if (num >= sizeof (base_map) / sizeof (base_map[0])) ++ continue; ++ target = base_map[num]; ++ if ((target >= 0) && (this->map[target] < 0)) ++ this->map[target] = i; ++ name_map[i] = num; /* for debug output below */ + } + this->left[0] = this->map[0] < 0 ? 0 : this->map[0]; + this->map[0] = -1; +@@ -641,8 +724,8 @@ static void ff_map_channels (ff_audio_decoder_t *this) { + "rear center", + "side left", "side right" + }; +- int8_t buf[200]; +- int p = sprintf (buf, "ff_audio_dec: channel layout: "); ++ int8_t buf[256]; ++ int p = sprintf (buf, "ff_audio_dec: %s channel layout: ", type); + int8_t *indx = this->left; + for (i = 0; i < 2; i++) { + buf[p++] = '['; +@@ -730,7 +813,7 @@ static void ff_audio_unparse (ff_audio_decoder_t *this) { + #define CLIP_16(v) ((v + 0x8000) & ~0xffff ? (v >> 31) ^ 0x7fff : v) + + static int ff_audio_decode (ff_audio_decoder_t *this) { +- int16_t *decode_buffer = (int16_t *)this->send.buf; ++ int16_t *decode_buffer = (int16_t *)ASSUME_ALIGNED_2 (this->send.buf, 2); + int consumed, got_frame = 0; + #if XFF_AUDIO >= 4 + float gain = this->class->gain; +@@ -805,13 +888,13 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + const stype *p1, *p2, *p3, *p4;\ + int i, sstep;\ + int8_t *x = idx;\ +- int16_t *dptr = (int16_t *)decode_buffer + dindx;\ ++ int16_t *dptr = decode_buffer + dindx;\ + if (planar) {\ +- p1 = (stype *)this->av_frame->extended_data[x[0]];\ ++ p1 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[0]], sizeof (stype));\ + if (!p1) break;\ + sstep = 1;\ + } else {\ +- p1 = (stype *)this->av_frame->extended_data[0];\ ++ p1 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype));\ + if (!p1) break;\ + p1 += x[0];\ + sstep = this->ff_channels;\ +@@ -827,10 +910,10 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + break;\ + }\ + if (planar) {\ +- p2 = (stype *)this->av_frame->extended_data[x[1]];\ ++ p2 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[1]], sizeof (stype));\ + if (!p2) break;\ + } else\ +- p2 = (stype *)this->av_frame->extended_data[0] + x[1];\ ++ p2 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype)) + x[1];\ + if (num == 2) {\ + for (i = 0; i < samples; i++) {\ + int32_t v = MIX_FIX(*p2);\ +@@ -845,10 +928,10 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + break;\ + }\ + if (planar) {\ +- p3 = (stype *)this->av_frame->extended_data[x[2]];\ ++ p3 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[2]], sizeof (stype));\ + if (!p3) break;\ + } else\ +- p3 = (stype *)this->av_frame->extended_data[0] + x[2];\ ++ p3 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype)) + x[2];\ + if (num == 3) {\ + for (i = 0; i < samples; i++) {\ + int32_t v = MIX_FIX(*p2);\ +@@ -865,10 +948,10 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + break;\ + }\ + if (planar) {\ +- p4 = (stype *)this->av_frame->extended_data[x[3]];\ ++ p4 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[3]], sizeof (stype));\ + if (!p4) break;\ + } else\ +- p4 = (stype *)this->av_frame->extended_data[0] + x[3];\ ++ p4 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype)) + x[3];\ + for (i = 0; i < samples; i++) {\ + int32_t v = MIX_FIX(*p2);\ + p2 += sstep;\ +@@ -937,13 +1020,13 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + int i, sstep;\ + float gain3;\ + int8_t *x = idx;\ +- int16_t *dptr = (int16_t *)decode_buffer + dindx;\ ++ int16_t *dptr = decode_buffer + dindx;\ + if (planar) {\ +- p1 = (stype *)this->av_frame->extended_data[x[0]];\ ++ p1 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[0]], sizeof (stype));\ + if (!p1) break;\ + sstep = 1;\ + } else {\ +- p1 = (stype *)this->av_frame->extended_data[0];\ ++ p1 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype));\ + if (!p1) break;\ + p1 += x[0];\ + sstep = this->ff_channels;\ +@@ -959,10 +1042,10 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + }\ + gain3 = gain * 0.7071;\ + if (planar) {\ +- p2 = (stype *)this->av_frame->extended_data[x[1]];\ ++ p2 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[1]], sizeof (stype));\ + if (!p2) break;\ + } else\ +- p2 = (stype *)this->av_frame->extended_data[0] + x[1];\ ++ p2 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype)) + x[1];\ + if (num == 2) {\ + for (i = 0; i < samples; i++) {\ + int32_t v = (*p1) * gain + (*p2) * gain3;\ +@@ -974,10 +1057,10 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + break;\ + }\ + if (planar) {\ +- p3 = (stype *)this->av_frame->extended_data[x[2]];\ ++ p3 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[2]], sizeof (stype));\ + if (!p3) break;\ + } else\ +- p3 = (stype *)this->av_frame->extended_data[0] + x[2];\ ++ p3 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype)) + x[2];\ + if (num == 3) {\ + for (i = 0; i < samples; i++) {\ + int32_t v = (*p1) * gain + (*p2 + *p3) * gain3;\ +@@ -990,10 +1073,10 @@ static int ff_audio_decode (ff_audio_decoder_t *this) { + break;\ + }\ + if (planar) {\ +- p4 = (stype *)this->av_frame->extended_data[x[3]];\ ++ p4 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[x[3]], sizeof (stype));\ + if (!p4) break;\ + } else\ +- p4 = (stype *)this->av_frame->extended_data[0] + x[3];\ ++ p4 = (stype *)ASSUME_ALIGNED_2 (this->av_frame->extended_data[0], sizeof (stype)) + x[3];\ + for (i = 0; i < samples; i++) {\ + int32_t v = (*p1) * gain + (*p2 + *p3 + *p4) * gain3;\ + p1 += sstep;\ +@@ -1174,8 +1257,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) + /* the above codecs output float samples, not 16-bit integers */ + int samples = this->send.len / sizeof(float); + float gain = this->class->gain; +- float *p = (float *)this->decode_buffer; +- int16_t *q = (int16_t *)this->decode_buffer; ++ float *p = (float *)ASSUME_ALIGNED_2 (this->decode_buffer, 4); ++ int16_t *q = (int16_t *)ASSUME_ALIGNED_2 (this->decode_buffer, 2); + int i; + for (i = samples; i; i--) { + int v = *p++ * gain; +@@ -1189,7 +1272,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) + int samples = this->send.len / (this->ff_channels * 2); + int channels = this->ao_channels; + int ff_channels = this->ff_channels; +- int16_t *p = (int16_t *)this->decode_buffer; ++ int16_t *p = (int16_t *)ASSUME_ALIGNED_2 (this->decode_buffer, 2); + int16_t *q = p; + int shift = this->downmix_shift, i, j; + /* downmix mono output to stereo first */ +@@ -1234,7 +1317,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) + } + /* final mono downmix */ + if (channels > this->ao_channels) { +- p = (int16_t *)this->decode_buffer; ++ p = (int16_t *)ASSUME_ALIGNED_2 (this->decode_buffer, 2); + q = p; + for (i = samples; i; i--) { + int v = *p++; +@@ -1310,11 +1393,27 @@ static void ff_audio_reset (audio_decoder_t *this_gen) { + XFF_FREE_FRAME (this->av_frame); + } + #endif ++#if 1 ++ avcodec_flush_buffers (this->context); ++#else + pthread_mutex_lock (&ffmpeg_lock); +- avcodec_close (this->context); +- if (XFF_AVCODEC_OPEN (this->context, this->codec) < 0) ++ { ++ uint8_t *ed = this->context->extradata; ++ int es = this->context->extradata_size; ++ this->context->extradata = NULL; ++ this->context->extradata_size = 0; ++ XFF_FREE_CONTEXT (this->context); + this->decoder_ok = 0; ++ this->context = XFF_ALLOC_CONTEXT (); ++ if (this->context) { ++ this->context->extradata = ed; ++ this->context->extradata_size = es; ++ } ++ } ++ if (XFF_AVCODEC_OPEN (this->context, this->codec) >= 0) ++ this->decoder_ok = 1; + pthread_mutex_unlock (&ffmpeg_lock); ++#endif + } + + ff_audio_reset_parser(this); +@@ -1352,20 +1451,20 @@ static void ff_audio_dispose (audio_decoder_t *this_gen) { + XFF_FREE_FRAME (this->av_frame); + } + #endif +- pthread_mutex_lock (&ffmpeg_lock); +- avcodec_close (this->context); +- pthread_mutex_unlock (&ffmpeg_lock); + } ++ pthread_mutex_lock (&ffmpeg_lock); ++ if (this->context) { ++ _x_freep (&this->context->extradata); ++ this->context->extradata_size = 0; ++ XFF_FREE_CONTEXT (this->context); ++ } ++ pthread_mutex_unlock (&ffmpeg_lock); + + ff_audio_output_close(this); + + xine_free_aligned (this->buf); + xine_free_aligned (this->decode_buffer); + +- _x_freep (&this->context->extradata); +- this->context->extradata_size = 0; +- XFF_FREE_CONTEXT (this->context); +- + XFF_PACKET_UNREF (this->avpkt); + + xine_pts_queue_delete (&this->pts_queue); +@@ -1447,6 +1546,12 @@ static void dispose_audio_class (audio_decoder_class_t *this_gen) { + free (this); + } + ++static void ff_bitexact_cb (void *user_data, xine_cfg_entry_t *entry) { ++ ff_audio_class_t *class = (ff_audio_class_t *)user_data; ++ ++ class->bitexact = entry->num_value; ++} ++ + void *init_audio_plugin (xine_t *xine, const void *data) { + + ff_audio_class_t *this ; +@@ -1474,5 +1579,12 @@ void *init_audio_plugin (xine_t *xine, const void *data) { + 10, ff_gain_cb, this) + / (float)20); + ++ this->bitexact = xine->config->register_bool (xine->config, ++ "audio.processing.ffmpeg_bitexact", 0, ++ _("Let FFmpeg use precise but slower math"), ++ _("Get slightly better sound, at the expense of speed.\n" ++ "Takes effect with next stream."), ++ 10, ff_bitexact_cb, this); ++ + return this; + } +diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c +index 54efc05..5a10225 100644 +--- a/src/combined/ffmpeg/ff_video_decoder.c ++++ b/src/combined/ffmpeg/ff_video_decoder.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2001-2022 the xine project ++ * Copyright (C) 2001-2024 the xine project + * + * This file is part of xine, a free video player. + * +@@ -89,6 +89,11 @@ + # define ENABLE_EMMS + #endif + ++/* ++#undef XFF_AVCODEC_SLICE_TABLE ++#define XFF_AVCODEC_SLICE_TABLE 1 ++*/ ++ + #define VIDEOBUFSIZE (128*1024) + #define SLICE_BUFFER_SIZE (1194*1024) + +@@ -128,6 +133,7 @@ struct ff_video_decoder_s { + + int64_t pts; + int64_t last_pts; ++ int64_t tagged_pts; + int video_step; + int reported_video_step; + uint8_t pts_tag_pass; +@@ -147,11 +153,11 @@ struct ff_video_decoder_s { + int bufsize; + int size; + int skipframes; +- ++#if XFF_AVCODEC_SLICE_TABLE == 1 + int *slice_offset_table; + int slice_offset_size; + int slice_offset_pos; +- ++#endif + AVFrame *av_frame; + AVFrame *av_frame2; + AVCodecContext *context; +@@ -237,6 +243,13 @@ struct ff_video_decoder_s { + #if XFF_VIDEO > 1 + XFF_PACKET_DECL (avpkt); + #endif ++ ++#if XFF_AVCODEC_SLICE_TABLE == 2 ++ uint8_t *temp_buf; ++ uint32_t temp_size; ++ int slice_num; ++ uint8_t slice_table[1 + 256 * 8]; ++#endif + }; + + /* import color matrix names */ +@@ -551,7 +564,9 @@ static int get_buffer_vaapi_vld (AVCodecContext *context, AVFrame *av_frame) + # ifdef XFF_FRAME_AGE + av_frame->age = 1; + # endif ++#ifdef XFF_AVCODEC_REORDERED_OPAQUE + av_frame->reordered_opaque = context->reordered_opaque; ++#endif + + ffsf = ffsf_new (this); + if (!ffsf) +@@ -862,7 +877,9 @@ static int get_buffer (AVCodecContext *context, AVFrame *av_frame) + # endif + + /* take over pts for this frame to have it reordered */ ++#ifdef XFF_AVCODEC_REORDERED_OPAQUE + av_frame->reordered_opaque = context->reordered_opaque; ++#endif + + return 0; + } +@@ -1142,9 +1159,13 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) + if (this->codec->id == CODEC_ID_VC1 && + (!this->bih.biWidth || !this->bih.biHeight)) { + /* VC1 codec must be re-opened with correct width and height. */ +- avcodec_close(this->context); +- +- if (XFF_AVCODEC_OPEN (this->context, this->codec) < 0) { ++ if (this->context) { ++ _x_freep (&this->context->extradata); ++ this->context->extradata_size = 0; ++ XFF_FREE_CONTEXT (this->context); ++ } ++ this->context = XFF_ALLOC_CONTEXT (); ++ if (!(this->context && XFF_AVCODEC_OPEN (this->context, this->codec) >= 0)) { + pthread_mutex_unlock(&ffmpeg_lock); + xprintf (this->stream->xine, XINE_VERBOSITY_LOG, + _("ffmpeg_video_dec: couldn't open decoder (pass 2)\n")); +@@ -1211,6 +1232,11 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) + /* dont want initial AV_NOPTS_VALUE here */ + this->context->reordered_opaque = 0; + #endif ++ ++#ifdef XFF_AVCODEC_FRAME_PTS ++ this->context->time_base.num = 1; ++ this->context->time_base.den = 90000 << 8; ++#endif + } + + #ifdef ENABLE_VAAPI +@@ -1398,7 +1424,7 @@ static void ff_setup_rgb2yuy2 (ff_video_decoder_t *this, int pix_fmt) { + #if defined(AV_PIX_FMT_YUV420P9) || defined(AV_PIX_FMT_YUV420P10) + static void ff_get_deep_color (uint8_t *src, int sstride, uint8_t *dest, int dstride, + int width, int height, uint8_t *tab) { +- uint16_t *p = (uint16_t *) src; ++ uint16_t *p = (uint16_t *)ASSUME_ALIGNED_2 (src, 2); + uint8_t *q = dest; + int spad = sstride / 2 - width; + int dpad = dstride - width; +@@ -1769,10 +1795,9 @@ static void ff_handle_header_buffer (ff_video_decoder_t *this, buf_element_t *bu + this->size += buf->size; + + if (buf->decoder_flags & BUF_FLAG_FRAME_END) { +- int codec_type; ++ uint32_t codec_type = buf->type & 0xFFFF0000; + + lprintf ("header complete\n"); +- codec_type = buf->type & 0xFFFF0000; + + if (buf->decoder_flags & BUF_FLAG_STDHEADER) { + +@@ -1804,22 +1829,24 @@ static void ff_handle_header_buffer (ff_video_decoder_t *this, buf_element_t *bu + #ifdef XFF_AVCODEC_SUB_ID + this->context->sub_id = _X_BE_32(&this->buf[30]); + #endif +- this->context->extradata_size = this->size - 26; +- if (this->context->extradata_size < 8) { +- this->context->extradata_size= 8; +- this->context->extradata = calloc(1, this->context->extradata_size + +- AV_INPUT_BUFFER_PADDING_SIZE); +- ((uint32_t *)this->context->extradata)[0] = 0; +- if (codec_type == BUF_VIDEO_RV10) +- ((uint32_t *)this->context->extradata)[1] = 0x10000000; +- else +- ((uint32_t *)this->context->extradata)[1] = 0x10003001; ++ if (this->size < 8 + 26) { ++ uint32_t *b = calloc (1, 8 + AV_INPUT_BUFFER_PADDING_SIZE); ++ if (b) { ++ this->context->extradata_size = 8; ++ this->context->extradata = (uint8_t *)b; ++ b[0] = 0; ++ if (codec_type == BUF_VIDEO_RV10) ++ b[1] = 0x10000000; ++ else ++ b[1] = 0x10003001; ++ } + } else { +- this->context->extradata = malloc(this->context->extradata_size + +- AV_INPUT_BUFFER_PADDING_SIZE); +- memcpy(this->context->extradata, this->buf + 26, +- this->context->extradata_size); +- memset(this->context->extradata + this->context->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); ++ this->context->extradata = malloc (this->size - 26 + AV_INPUT_BUFFER_PADDING_SIZE); ++ if (this->context->extradata) { ++ this->context->extradata_size = this->size - 26; ++ memcpy (this->context->extradata, this->buf + 26, this->context->extradata_size); ++ memset (this->context->extradata + this->context->extradata_size, 0, AV_INPUT_BUFFER_PADDING_SIZE); ++ } + } + + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, +@@ -1896,33 +1923,44 @@ static void ff_handle_special_buffer (ff_video_decoder_t *this, buf_element_t *b + #endif + } + else if (buf->decoder_info[1] == BUF_SPECIAL_RV_CHUNK_TABLE) { +- /* o dear. Multiple decoding threads use individual contexts. +- av_decode_video2 () does only copy the _pointer_ to the offsets, +- not the offsets themselves. So we must not overwrite anything +- that another thread has not yet read. */ +- int i, l, total; +- +- lprintf("BUF_SPECIAL_RV_CHUNK_TABLE\n"); +- l = buf->decoder_info[2] + 1; +- +- total = l * this->class->thread_count; +- if (total < SLICE_OFFSET_SIZE) +- total = SLICE_OFFSET_SIZE; +- if (total > this->slice_offset_size) { +- this->slice_offset_table = realloc (this->slice_offset_table, total * sizeof (int)); +- this->slice_offset_size = total; +- } ++ { ++#if XFF_AVCODEC_SLICE_TABLE == 1 ++ /* o dear. Multiple decoding threads use individual contexts. ++ * av_decode_video2 () does only copy the _pointer_ to the offsets, ++ * not the offsets themselves. So we must not overwrite anything ++ * that another thread has not yet read. */ ++ int i, l, total; ++ ++ lprintf("BUF_SPECIAL_RV_CHUNK_TABLE\n"); ++ l = buf->decoder_info[2] + 1; ++ ++ total = l * this->class->thread_count; ++ if (total < SLICE_OFFSET_SIZE) ++ total = SLICE_OFFSET_SIZE; ++ if (total > this->slice_offset_size) { ++ this->slice_offset_table = realloc (this->slice_offset_table, total * sizeof (int)); ++ this->slice_offset_size = total; ++ } + +- if (this->slice_offset_pos + l > this->slice_offset_size) +- this->slice_offset_pos = 0; +- this->context->slice_offset = this->slice_offset_table + this->slice_offset_pos; +- this->context->slice_count = l; ++ if (this->slice_offset_pos + l > this->slice_offset_size) ++ this->slice_offset_pos = 0; ++ this->context->slice_offset = this->slice_offset_table + this->slice_offset_pos; ++ this->context->slice_count = l; + +- lprintf ("slice_count=%d\n", l); +- for (i = 0; i < l; i++) { +- this->slice_offset_table[this->slice_offset_pos++] = +- ((uint32_t *)buf->decoder_info_ptr[2])[(2 * i) + 1]; +- lprintf("slice_offset[%d]=%d\n", i, this->context->slice_offset[i]); ++ lprintf ("slice_count=%d\n", l); ++ for (i = 0; i < l; i++) { ++ this->slice_offset_table[this->slice_offset_pos++] = ++ ((uint32_t *)buf->decoder_info_ptr[2])[(2 * i) + 1]; ++ lprintf("slice_offset[%d]=%d\n", i, this->context->slice_offset[i]); ++ } ++#elif XFF_AVCODEC_SLICE_TABLE == 2 ++ /* (count-1):1, 1:4, (offs[0]):4, 1:4, (offs[1]:4, ... just in front of the frame bitstream. ++ * reverse engineered from ffmpeg/libavcodec/rv34.c. they seem to expect no ++ * external use of rv decoders, and did not document this. */ ++ this->slice_table[0] = buf->decoder_info[2]; ++ this->slice_num = this->slice_table[0] + 1; ++ memcpy (this->slice_table + 1, buf->decoder_info_ptr[2], 8 * this->slice_num); ++#endif + } + } + } +@@ -1957,7 +1995,26 @@ static int64_t ff_tag_pts (ff_video_decoder_t *this, int64_t pts) { + return (pts * 256) | this->pts_tag_pass; + } + +-static int64_t ff_untag_pts (ff_video_decoder_t *this, int64_t pts) { ++static int64_t ff_untag_pts (ff_video_decoder_t *this, AVFrame *av_frame) { ++ int64_t pts; ++#if defined(XFF_AVCODEC_FRAME_PTS) ++ pts = (av_frame->pts != AV_NOPTS_VALUE) ? av_frame->pts : 0; ++# if defined(XFF_AVCODEC_REORDERED_OPAQUE) ++ /* paranoia !!! */ ++ if (pts != av_frame->reordered_opaque) { ++ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, ++ LOG_MODULE ": WARNING: frame pts %" PRId64 " != reordered_opaque %" PRId64 ".\n", ++ pts, av_frame->reordered_opaque); ++ pts = av_frame->reordered_opaque; ++ } ++ av_frame->reordered_opaque = 0; ++# endif ++#elif defined(XFF_AVCODEC_REORDERED_OPAQUE) ++ pts = av_frame->reordered_opaque; ++ av_frame->reordered_opaque = 0; ++#else ++ pts = this->tagged_pts; ++#endif + if ((uint8_t)(pts & 0xff) == this->pts_tag_pass) { + /* restore sign. */ + return pts >> 8; +@@ -1969,6 +2026,7 @@ static int64_t ff_untag_pts (ff_video_decoder_t *this, int64_t pts) { + + static int decode_video_wrapper (ff_video_decoder_t *this, + AVFrame *av_frame, int *err, void *buf, size_t buf_size) { ++ uint32_t tsize = 0; + int len; + + #if ENABLE_VAAPI +@@ -1978,11 +2036,36 @@ static int decode_video_wrapper (ff_video_decoder_t *this, + } + #endif /* ENABLE_VAAPI */ + ++#if XFF_AVCODEC_SLICE_TABLE == 2 ++ if ((this->slice_num > 0) && buf) { ++ uint32_t nsize; ++ tsize = 1 + this->slice_num * 8; ++ nsize = tsize + buf_size + AV_INPUT_BUFFER_PADDING_SIZE; ++ if (this->temp_size < nsize) { ++ nsize = nsize * 3 / 2; ++ free (this->temp_buf); ++ this->temp_buf = malloc (nsize); ++ if (!this->temp_buf) ++ nsize = 0; ++ this->temp_size = nsize; ++ nsize = tsize + buf_size + AV_INPUT_BUFFER_PADDING_SIZE; ++ } ++ if (this->temp_size >= nsize) { ++ memcpy (this->temp_buf, this->slice_table, tsize); ++ memcpy (this->temp_buf + tsize, buf, buf_size + AV_INPUT_BUFFER_PADDING_SIZE); ++ buf = this->temp_buf; ++ } ++ this->slice_num = 0; ++ } ++#endif ++ + #if XFF_VIDEO > 1 + this->avpkt->data = buf; +- this->avpkt->size = buf_size; ++ this->avpkt->size = buf_size + tsize; + this->avpkt->flags = AV_PKT_FLAG_KEY; +- ++# ifdef XFF_AVCODEC_FRAME_PTS ++ this->avpkt->pts = this->tagged_pts; ++# endif + # if XFF_PALETTE == 2 || XFF_PALETTE == 3 + if (buf && this->palette_changed) { + uint8_t *sd = av_packet_new_side_data (this->avpkt, AV_PKT_DATA_PALETTE, 256 * 4); +@@ -2092,9 +2175,14 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_t *this, buf_element_t *bu + #endif + + /* apply valid pts to first frame _starting_ thereafter only */ +- if (this->pts && !this->context->reordered_opaque) { +- this->context->reordered_opaque = +- this->av_frame->reordered_opaque = ff_tag_pts (this, this->pts); ++ if (this->pts && !this->tagged_pts) { ++ this->tagged_pts = ff_tag_pts (this, this->pts); ++#ifdef XFF_AVCODEC_REORDERED_OPAQUE ++ this->context->reordered_opaque = this->av_frame->reordered_opaque = this->tagged_pts; ++#endif ++#ifdef XFF_AVCODEC_FRAME_PTS ++ this->av_frame->pts = this->tagged_pts; ++#endif + this->pts = 0; + } + +@@ -2205,9 +2293,11 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_t *this, buf_element_t *bu + img->top_field_first = this->av_frame->top_field_first; + + /* get back reordered pts */ +- img->pts = ff_untag_pts (this, this->av_frame->reordered_opaque); +- this->av_frame->reordered_opaque = 0; ++ img->pts = ff_untag_pts (this, this->av_frame); ++ this->tagged_pts = 0; ++#ifdef XFF_AVCODEC_REORDERED_OPAQUE + this->context->reordered_opaque = 0; ++#endif + + if (this->av_frame->repeat_pict) + img->duration = this->video_step * 3 / 2; +@@ -2328,9 +2418,14 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { + } + + if (this->size == 0) { ++ this->tagged_pts = ff_tag_pts (this, this->pts); + /* take over pts when we are about to buffer a frame */ +- this->av_frame->reordered_opaque = ff_tag_pts(this, this->pts); +- this->context->reordered_opaque = ff_tag_pts(this, this->pts); ++#ifdef XFF_AVCODEC_REORDERED_OPAQUE ++ this->av_frame->reordered_opaque = this->context->reordered_opaque = this->tagged_pts; ++#endif ++#ifdef XFF_AVCODEC_FRAME_PTS ++ this->av_frame->pts = this->tagged_pts; ++#endif + this->pts = 0; + } + +@@ -2403,7 +2498,10 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { + need_unref = 1; + #endif + /* reset consumed pts value */ +- this->context->reordered_opaque = ff_tag_pts(this, 0); ++ this->tagged_pts = ff_tag_pts (this, 0); ++#ifdef XFF_AVCODEC_REORDERED_OPAQUE ++ this->context->reordered_opaque = this->tagged_pts; ++#endif + + if (err) { + +@@ -2434,13 +2532,16 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { + this->size -= len; + + if (this->size > 0) { +- ff_check_bufsize(this, this->size); + memmove (this->buf, &chunk_buf[offset], this->size); + chunk_buf = this->buf; +- + /* take over pts for next access unit */ +- this->av_frame->reordered_opaque = ff_tag_pts(this, this->pts); +- this->context->reordered_opaque = ff_tag_pts(this, this->pts); ++ this->tagged_pts = ff_tag_pts (this, this->pts); ++#ifdef XFF_AVCODEC_REORDERED_OPAQUE ++ this->av_frame->reordered_opaque = this->context->reordered_opaque = this->tagged_pts; ++#endif ++#ifdef XFF_AVCODEC_FRAME_PTS ++ this->av_frame->pts = this->tagged_pts; ++#endif + this->pts = 0; + } + } +@@ -2557,11 +2658,10 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { + ff_convert_frame(this, img, this->av_frame); + } + +- img->pts = ff_untag_pts(this, this->av_frame->reordered_opaque); +- this->av_frame->reordered_opaque = 0; ++ img->pts = ff_untag_pts(this, this->av_frame); + +- /* workaround for weird 120fps streams */ +- if( video_step_to_use == 750 ) { ++ /* workaround for weird 120fps streams, as well as some rv20 with frame duration 3pts. */ ++ if (video_step_to_use <= 750) { + /* fallback to the VIDEO_PTS_MODE */ + video_step_to_use = 0; + } +@@ -2598,8 +2698,7 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) { + this->output_format, + VO_BOTH_FIELDS|this->frame_flags); + /* set PTS to allow early syncing */ +- img->pts = ff_untag_pts(this, this->av_frame->reordered_opaque); +- this->av_frame->reordered_opaque = 0; ++ img->pts = ff_untag_pts(this, this->av_frame); + + img->duration = video_step_to_use; + +@@ -2781,9 +2880,9 @@ static void ff_flush_internal (ff_video_decoder_t *this, int display) { + ff_convert_frame (this, img, this->av_frame2); + } + +- img->pts = ff_untag_pts (this, this->av_frame2->reordered_opaque); ++ img->pts = ff_untag_pts (this, this->av_frame2); + +- if (video_step_to_use == 750) ++ if (video_step_to_use <= 750) + video_step_to_use = 0; + img->duration = this->av_frame2->repeat_pict ? video_step_to_use * 3 / 2 : video_step_to_use; + img->progressive_frame = !this->av_frame2->interlaced_frame; +@@ -2887,6 +2986,9 @@ static void ff_reset (video_decoder_t *this_gen) { + mpeg_parser_reset(this->mpeg_parser); + + /* this->pts_tag_pass = 0; */ ++#if XFF_AVCODEC_SLICE_TABLE == 2 ++ this->slice_num = 0; ++#endif + } + + static void ff_dispose (video_decoder_t *this_gen) { +@@ -2899,10 +3001,15 @@ static void ff_dispose (video_decoder_t *this_gen) { + rgb2yuy2_free (this->rgb2yuy2); + + if (this->decoder_ok) { ++ uint8_t *ed; + + pthread_mutex_lock(&ffmpeg_lock); +- avcodec_close (this->context); ++ ed = this->context->extradata; ++ this->context->extradata = NULL; ++ this->context->extradata_size = 0; ++ XFF_FREE_CONTEXT (this->context); + pthread_mutex_unlock(&ffmpeg_lock); ++ _x_freep (&ed); + + #ifdef ENABLE_DIRECT_RENDERING + ff_free_dr1_frames (this, 1); +@@ -2910,17 +3017,18 @@ static void ff_dispose (video_decoder_t *this_gen) { + + this->stream->video_out->close(this->stream->video_out, this->stream); + this->decoder_ok = 0; +- } +- +- if (this->slice_offset_table) +- free (this->slice_offset_table); +- +- if (this->context) { ++ } else if (this->context) { + _x_freep (&this->context->extradata); + this->context->extradata_size = 0; + XFF_FREE_CONTEXT (this->context); + } + ++#if XFF_AVCODEC_SLICE_TABLE == 1 ++ free (this->slice_offset_table); ++#elif XFF_AVCODEC_SLICE_TABLE == 2 ++ free (this->temp_buf); ++#endif ++ + #if XFF_VIDEO > 1 + XFF_PACKET_UNREF (this->avpkt); + #endif +@@ -3007,21 +3115,25 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen, + this->decoder_ok = 0; + this->aspect_ratio = 0; + this->pts_tag_pass = 0; +-#ifdef HAVE_POSTPROC ++# ifdef HAVE_POSTPROC + this->pp_quality = 0; + this->our_context = NULL; + this->our_mode = NULL; +-#endif ++# endif + this->mpeg_parser = NULL; + this->set_stream_info = 0; + this->rgb2yuy2 = NULL; +-#ifdef ENABLE_VAAPI ++# ifdef ENABLE_VAAPI + this->accel = NULL; + this->accel_img = NULL; +-#endif +-#if XFF_VIDEO == 3 ++# endif ++# if XFF_VIDEO == 3 + this->flush_packet_sent = 0; +-#endif ++# endif ++# if XFF_AVCODEC_SLICE_TABLE == 2 ++ this->temp_size = 0; ++ this->temp_buf = NULL; ++# endif + #endif + + this->video_decoder.decode_data = ff_decode_data; +diff --git a/src/combined/ffmpeg/ffmpeg_compat.h b/src/combined/ffmpeg/ffmpeg_compat.h +index 803ace2..01096a7 100644 +--- a/src/combined/ffmpeg/ffmpeg_compat.h ++++ b/src/combined/ffmpeg/ffmpeg_compat.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2000-2022 the xine project ++ * Copyright (C) 2000-2024 the xine project + * + * This file is part of xine, a unix video player. + * +@@ -54,9 +54,16 @@ + #endif + + /* reordered_opaque appeared in libavcodec 51.68.0 */ +-#define XFF_AVCODEC_REORDERED_OPAQUE +-#if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(51,68,0) +-# undef XFF_AVCODEC_REORDERED_OPAQUE ++#if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(51,68,0) && LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(60,0,0) ++# define XFF_AVCODEC_REORDERED_OPAQUE ++#else ++# undef XFF_AVCODEC_REORDERED_OPAQUE ++#endif ++ ++#if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(58,33,100) ++# define XFF_AVCODEC_FRAME_PTS ++#else ++# undef XFF_AVCODEC_FRAME_PTS + #endif + + /* colorspace and color_range were added before 52.29.0 */ +@@ -132,6 +139,14 @@ + # define XFF_PALETTE 3 + #endif + ++#if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,42,100) ++/* AVCodecContext.slice_{offset,count} */ ++# define XFF_AVCODEC_SLICE_TABLE 1 ++#else ++/* inline offset table before the frame. */ ++# define XFF_AVCODEC_SLICE_TABLE 2 ++#endif ++ + #if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(59,0,100) /** << revise this */ + # define XFF_VAAPI 1 /** << libavcodec/vaapi.h */ + #else +@@ -210,9 +225,11 @@ + #endif + + #if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(55,63,100) +-# define XFF_FREE_CONTEXT(pp) do {av_free(pp); pp = NULL;} while (0) ++# define XFF_FREE_CONTEXT(pp) do {if (pp) avcodec_close (pp); av_free (pp); pp = NULL;} while (0) ++#elif LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(58,33,100) ++# define XFF_FREE_CONTEXT(pp) do {if (pp) avcodec_close (pp); avcodec_free_context (&(pp));} while (0) + #else +-# define XFF_FREE_CONTEXT(pp) avcodec_free_context(&(pp)) ++# define XFF_FREE_CONTEXT(pp) avcodec_free_context (&(pp)) + #endif + + #if LIBAVCODEC_VERSION_INT < XFF_INT_VERSION(54,59,100) +@@ -303,4 +320,3 @@ + #endif /* defined(LIBAVCODEC_VERSION_INT) */ + + #endif /* XINE_AVCODEC_COMPAT_H */ +- +diff --git a/src/dxr3/ffmpeg_encoder.c b/src/dxr3/ffmpeg_encoder.c +index 42dee3a..f45d60d 100644 +--- a/src/dxr3/ffmpeg_encoder.c ++++ b/src/dxr3/ffmpeg_encoder.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2000-2022 the xine project ++ * Copyright (C) 2000-2024 the xine project + * + * This file is part of xine, a unix video player. + * +@@ -127,10 +127,8 @@ static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame) + unsigned char use_quantizer; + + if (this->context) { +- avcodec_close(this->context); +- free(this->context); ++ XFF_FREE_CONTEXT (this->context); + free(this->picture); +- this->context = NULL; + this->picture = NULL; + } + +@@ -344,10 +342,8 @@ static int lavc_on_unneeded(dxr3_driver_t *drv) + #if XFF_ENCVIDEO > 1 + XFF_PACKET_UNREF (this->pkt); + #endif +- avcodec_close(this->context); + XFF_FREE_CONTEXT (this->context); + free(this->picture); +- this->context = NULL; + this->picture = NULL; + } + return 1; diff --git a/xine-lib-libdvdread_udf.diff b/xine-lib-libdvdread_udf.diff new file mode 100644 index 0000000..3cdeadd --- /dev/null +++ b/xine-lib-libdvdread_udf.diff @@ -0,0 +1,122 @@ +# HG changeset patch +# User Tobias Rautenkranz +# Date 1202208482 -3600 +# Node ID 100241ff36f0730a15018a58456fb86eb590bf18 +# Parent 07c29261ed98fdb710a241c6711dac0215b6074a +Fix playback of DVDs with a broken UDF file system (aka DVD-Movie-Protect). + +--- a/src/input/libdvdnav/dvd_udf.c ++++ b/src/input/libdvdnav/dvd_udf.c +@@ -38,10 +38,16 @@ + #include + #include + #include ++#ifndef __WIN32__ ++#include ++#endif + + #include "dvd_reader.h" + #include "dvd_udf.h" + ++#include "ifo_types.h" ++#include "ifo_read.h" ++ + /* Private but located in/shared with dvd_reader.c */ + extern int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number, + size_t block_count, unsigned char *data, +@@ -779,7 +785,9 @@ static int UDFFindPartition( dvd_reader_ + return part->valid; + } + +-uint32_t UDFFindFile( dvd_reader_t *device, char *filename, ++ ++ ++static uint32_t UDFFindFileReal( dvd_reader_t *device, char *filename, + uint32_t *filesize ) + { + uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; +@@ -861,6 +869,84 @@ uint32_t UDFFindFile( dvd_reader_t *devi + return partition.Start + File.Location; + } + ++/** ++ * Get the offset from the ifo files to allow playback of DVDs ++ * with a deliberately broken UDF file system (aka DVD-Movie-Protect). ++ * When the file is not an IFO or VOB, it calls the real UDF routine. ++ */ ++uint32_t UDFFindFile( dvd_reader_t *device, char *filename, ++ uint32_t *filesize ) ++{ ++#ifndef __WIN32__ ++ if (!fnmatch("/VIDEO_TS/VTS_[0-9][0-9]_[0-9].???", filename, FNM_PATHNAME)) { ++#else ++ if (strlen("/VIDEO_TS/VTS_01_1.VOB") == strlen(filename) ++ && !strncmp(filename, "/VIDEO_TS/VTS_", strlen("/VIDEO_TS/VTS_")) ) { ++#endif ++ size_t len = strlen(filename); ++ char *extension = &filename[len-3]; ++ if (!strcmp(extension, "IFO") || !strcmp(extension, "VOB")) { ++ int title = atoi(&filename[len-8]); ++ int part = atoi(&filename[len-5]); ++ ++ ifo_handle_t *ifo_handle = ifoOpen(device, 0); ++ if (0 == ifo_handle) ++ return 0; ++ ++ uint32_t tmp_filesize; ++ uint32_t offset = UDFFindFileReal(device, "/VIDEO_TS/VIDEO_TS.IFO", &tmp_filesize); ++ ++ int i; ++ for (i=0; itt_srpt->nr_of_srpts; i++) ++ if (title == ifo_handle->tt_srpt->title[i].title_set_nr) ++ break; ++ ++ if (i == ifo_handle->tt_srpt->nr_of_srpts) { ++ /* not found */ ++ ifoClose(ifo_handle); ++ return 0; ++ } ++ offset += ifo_handle->tt_srpt->title[i].title_set_sector; ++ ifoClose(ifo_handle); ++ ++ if (!strcmp(extension, "VOB")) { ++ ifo_handle = ifoOpen(device, title); ++ if (0 == ifo_handle) ++ return 0; ++ ++ switch(part) { ++ case 0: ++ if (0 == ifo_handle->vtsi_mat->vtsm_vobs) { ++ ifoClose(ifo_handle); ++ return 0; ++ } ++ offset += ifo_handle->vtsi_mat->vtsm_vobs; ++ break; ++ case 1: ++ if (0 == ifo_handle->vtsi_mat->vtstt_vobs) { ++ ifoClose(ifo_handle); ++ return 0; ++ } ++ offset += ifo_handle->vtsi_mat->vtstt_vobs; ++ break; ++ default: /* can't get other parts (also no need to) */ ++ offset = 0; ++ break; ++ } ++ ++ ifoClose(ifo_handle); ++ } ++ ++ ++ *filesize = 1000000; /* File size unknown */ ++ if (offset != 0) ++ return offset; ++ } ++ } ++ ++ return UDFFindFileReal( device, filename, filesize); ++} ++ + + + /** diff --git a/xine-lib-theora.patch b/xine-lib-theora.patch new file mode 100644 index 0000000..2f34da7 --- /dev/null +++ b/xine-lib-theora.patch @@ -0,0 +1,13 @@ +Index: xine-lib-1.2.10/src/xine-engine/buffer_types.c +=================================================================== +--- xine-lib-1.2.10.orig/src/xine-engine/buffer_types.c 2020-01-25 12:58:18.799239039 +0200 ++++ xine-lib-1.2.10/src/xine-engine/buffer_types.c 2020-01-25 13:10:17.475944459 +0200 +@@ -248,6 +248,8 @@ static const uint32_t sorted_video_4ccs[ + BE_FOURCC('S', 'N', 'O', 'W'), BUF_VIDEO_SNOW, + BE_FOURCC('S', 'V', 'Q', '1'), BUF_VIDEO_SORENSON_V1, + BE_FOURCC('S', 'V', 'Q', '3'), BUF_VIDEO_SORENSON_V3, ++ BE_FOURCC('t', 'h', 'e', 'o'), BUF_VIDEO_THEORA, ++ BE_FOURCC('T', 'H', 'E', 'O'), BUF_VIDEO_THEORA, + BE_FOURCC('T', 'M', '2', '0'), BUF_VIDEO_DUCKTM2, + BE_FOURCC('U', '2', '6', '3'), BUF_VIDEO_H263, + BE_FOURCC('U', 'C', 'O', 'D'), BUF_VIDEO_UCOD, diff --git a/xine-lib-v4l-2.6.38.patch b/xine-lib-v4l-2.6.38.patch new file mode 100644 index 0000000..69db4d3 --- /dev/null +++ b/xine-lib-v4l-2.6.38.patch @@ -0,0 +1,26 @@ +Index: xine-lib-1.2.10/m4/input.m4 +=================================================================== +--- xine-lib-1.2.10.orig/m4/input.m4 2019-12-13 22:47:50.000000000 +0200 ++++ xine-lib-1.2.10/m4/input.m4 2020-01-25 12:34:03.983185893 +0200 +@@ -105,7 +105,7 @@ AC_DEFUN([XINE_INPUT_PLUGINS], [ + XINE_ARG_ENABLE([v4l], [Enable Video4Linux support]) + if test x"$enable_v4l" != x"no"; then + have_v4l=yes +- AC_CHECK_HEADERS([linux/videodev.h], , [have_v4l=no]) ++ AC_CHECK_HEADERS([libv4l1-videodev.h], , [have_v4l=no]) + AC_CHECK_HEADERS([asm/types.h]) + if test x"$hard_enable_v4l" = x"yes" && test x"$have_v4l" != x"yes"; then + AC_MSG_ERROR([Video4Linux support requested, but prerequisite headers not found.]) +Index: xine-lib-1.2.10/src/input/input_v4l.c +=================================================================== +--- xine-lib-1.2.10.orig/src/input/input_v4l.c 2019-12-13 22:47:50.000000000 +0200 ++++ xine-lib-1.2.10/src/input/input_v4l.c 2020-01-25 12:34:03.983185893 +0200 +@@ -47,7 +47,7 @@ + */ + #define _LINUX_TIME_H + +-#include ++#include + #include + #include + #include diff --git a/xine-lib.changes b/xine-lib.changes new file mode 100644 index 0000000..b5e7d1a --- /dev/null +++ b/xine-lib.changes @@ -0,0 +1,607 @@ +------------------------------------------------------------------- +Thu Aug 8 05:29:06 UTC 2024 - Christophe Marin + +- Add ffmpeg-7 compatibility patch: + * xine-lib-ffmpeg-7.patch + +------------------------------------------------------------------- +Mon Jul 15 13:17:26 UTC 2024 - Martin Jambor + +- Add xine-lib-configure-c99.patch to avoid C99 violations during + configure phase [boo#1225957] + +------------------------------------------------------------------- +Tue Dec 12 12:12:12 UTC 2023 - olaf@aepfle.de + +- Add version constraints for all ffmpeg subpackages + +------------------------------------------------------------------- +Tue Mar 21 10:33:40 UTC 2023 - Bjørn Lie + +- Add explicit pkgconfig(egl) BuildRequires, configure checks for + it. Previously pulled in by chance via cairo. + +------------------------------------------------------------------- +Sat Jan 28 15:41:11 UTC 2023 - Dave Plater + +- Prevent Leap:15.4 building with ffmpeg-3 + +------------------------------------------------------------------- +Fri Jan 27 09:15:38 UTC 2023 - Wolfgang Bauer + +- Update to version 1.2.13 +- Remove xine-lib-ffmpeg5.patch, fixed upstream +- Upstream changes: + * Add dav1d 1.0.0 support. + * Add user video frame rate limiter. + * Add xine_query_stream_info (). + * Add user OpenGL2 scale modes. + * Add xine timespec tools. + * FFmpeg compatibility update. + * Update german translation. + * Improved DVB subtitle support. + * Improved HLS input. + * Improved AAC demux. + * Fix clang build. + * Fix build with libcaca. + * Fix fine time display. + * Fix .mp4 audio. + * Fix wav demuxer. + * Work around broken Mesa vdpau drivers. + * Fix OpenGL2 deep color display. + * Various small fixes. + * Optimize OpenGL2 video output. + * Optimize audio out. + * Optimize OSD. + * Small engine optimizations. + +------------------------------------------------------------------- +Thu Sep 8 06:05:38 UTC 2022 - Bjørn Lie + +- Add xine-lib-ffmpeg5.patch: Fix build with ffmpeg-5. + +------------------------------------------------------------------- +Tue May 17 07:08:56 UTC 2022 - Dominique Leuenberger + +- Replace SDL-devel BuildRequires with pkgconfig(sdl): allow to use + sdl12_compat as an alternative. + +------------------------------------------------------------------- +Tue Mar 15 10:46:27 UTC 2022 - Wolfgang Bauer + +- Fix non-distributable build: + * Add "BuildRequires: pkgconfig(glesv2)" to avoid compiler error + about missing include file + * Adjust plugins filelist + +------------------------------------------------------------------- +Tue Mar 15 07:43:31 UTC 2022 - Wolfgang Bauer + +- Update to version 1.2.12 +- Rebase xine-lib-libdvdread_udf.diff +- Upstream changes: + * Add string tree library (generic info parser). + * Add OpenSL ES audio output plugin. + * Add mpeg-dash input plugin. + * Add crypto input plugin. + * Add VAAPI support to opengl2 video output (requires using EGL). + * Better hls support. + * Improved DVB/live stream timing. + * Improved BT.2020 support. + * Fix compatibility with ffmpeg 5.0. + * Fix RSS parser. + * Fix output parameter setting (audio amplification, video hue etc.). + * Fix AC3 demuxer. + * Diverse small fixes and optimizations. + * Update german translation. + * Code cleanup. + * Build fixes. + +------------------------------------------------------------------- +Mon Mar 14 14:14:14 UTC 2022 - olaf@aepfle.de + +- Use pkgconfig(smbclient) to refer to samba libaries + +------------------------------------------------------------------- +Wed Jan 6 18:52:25 UTC 2021 - Wolfgang Bauer + +- Update to version 1.2.11 +- Remove xine-lib-dec_info_real.patch, fixed upstream +- Upstream changes: + * Add gopher input plugin. + * Add user settings for IPv6. + * Split a52 spdif output to separate decoder. + * Code cleanup. + * More engine optimization. + * Small optimizations (opengl2, dvb subtitles, png, mpeg-ts). + * Better A/V sync. + * Fix a few crashes. + * Fix bluray playback. + * Fix VAAPI picture jitter and green flashes. + * Fix Opus and EAC3 audio playback. + * Fix text subtitles. + * Fix mpeg-ts (hdmv mode, detection of cut TV recordings). + * Fix mpeg layer 1-4 audio timing. + * Fix some VDR issues. + * Fix HLS VOD mode. + * Many small fixes. + * Build fixes. + * BSD fixes. + * Update german translation. + * Update internal libdca to upstream 0.0.7. + +------------------------------------------------------------------- +Fri Jun 5 20:20:20 UTC 2020 - olaf@aepfle.de + +- Remove xineplug_decode_qt to fix i386 build + +------------------------------------------------------------------- +Fri Jun 5 15:15:15 UTC 2020 - olaf@aepfle.de + +- Fix build with xine-lib-dec_info_real.patch + +------------------------------------------------------------------- +Sun Jan 26 14:11:29 UTC 2020 - Dave Plater + +- Update to version 1.2.10 and remove incorporated patches: + xine-lib-contrib.patch, xine-lib-alsa.patch, xine-lib-a52dec.patch + and xine-lib-ImageMagick7.patch. +- Upstream changes: + *Add (xcb)xv yuy2 emulation. + *Add libavcodec v58 compatibility. + *Add avio seek support. + *Add libdav1d, libaom and lavc AV1 video decoders. + *Add libvpx multithreading. + *Add libpng decoder. + *Add a52 double and fixed point modes. + *Add Opus audio support to ogg demuxer. + *Add AV1 video support to matroska demuxer. + *Add ivf demuxer. + *Add mpeg-ts split payload support. + *Add TLS support using gnutls or OpenSSL. + *Add ftp input plugin (ftp://) with TLS support (ftpes://) + *Add tls:// input plugin (raw TLS over TCP). + *Add libnfs NFS input plugin. + *Add ftp/http seek support. + *Add scp forward seek support. + *Add mp4 http streaming support (plain and fragment modes). + *Add HLS streaming support. + *Add HTTP 1.1 support. + *Add OpenGL EGL and Wayland support. + *Add side stream feature. + *Optimize OSD. + *Optimize output layers. + *Optimize decoder threads. + *Optimize event handling. + *Optimize stream info. + *Optimize TCP/TLS/HTTP network input. + *Optimize network buffering control. + *Alsa/oss startup optimization. + *Optimize input_stdin_fifo. + *Optimize internal liba52. + *Optimize user seek. + *Better support for audio out drivers that cannot resume after pause. + *Better support for mpeg pts jumps. + *Better bluray seek. + *XML parser fixes. + *Fix midstream audio mode switch. + *Fix FLAC audio playback via ffmpeg. + *Fix ffmpeg mpeg1/2 video. + *Fix/optimize mpeg, mpeg-ts, qt, flv, matroska, real & asf demuxers. + *Fix network seek. + *Fix/optimize audio CD. + *Fix DVD (occasional crashes, damaged video after a DVD had been + played). + *Fix opengl2 freeze after X server failure. + *Fix tvtime deinterlacer crash. + *Fix/optimize overlay. + *Fix/optimize old VDR plugin. + *Fix xine-ui freeze when opening a playlist while paused. + *Security fixes. + *More error handling instead of aborting. + +------------------------------------------------------------------- +Sat Apr 13 20:02:32 UTC 2019 - olaf@aepfle.de + +- Package xineplug_post_tvtime also on arm64 +- Added xine-lib-contrib.patch +- Remove disabled esd support +- Remove disabled directfb support +- Remove disabled aalib support +- Remove disabled gnome_vfs support +- Use gcc8 in SLE_12 +- Use plain configure macro +- Fix opensuse.org XINE URL +- Use without instead of !with distributable/onlynondistributable/ffmpeg/sdl +- Remove disabled code for sle10 +- Remove conditional for ffmpeg because it always exists +- Remove unused xine-lib-without-ffmpeg.patch +- Remove unused xine-lib-nukefaadetc.patch, use sed instead +- Adjust all patches for autosetup: + xine-lib-libdvdread_udf.diff + xine-lib-v4l-2.6.38.patch + xine-lib-alsa.patch + xine-lib-theora.patch + xine-lib-ImageMagick7.patch + xine-lib-a52dec.patch + +------------------------------------------------------------------- +Tue Mar 26 07:03:44 UTC 2019 - olaf@aepfle.de + +- Use alsa API properly with xine-lib-alsa.patch. Consumers are + expected to use instead of . + This is in preparation of an change to pkgconfig(alsa) to + not pollute CFLAGS with -I/usr/include/alsa anymore (bsc#1130333) + +------------------------------------------------------------------- +Fri Feb 22 12:00:57 UTC 2019 - olaf@aepfle.de + +- Package xineplug_post_tvtime also on arm32 + +------------------------------------------------------------------- +Sun Jan 6 10:51:20 UTC 2019 - schwab@suse.de + +- fix-non-x86-build.diff: remove + +------------------------------------------------------------------- +Sat Dec 29 12:53:21 UTC 2018 - davejplater@gmail.com + +- Patched up crippled build with new perl, the perl scripts no + longer work. +- Added xine-lib-nukefaadetc.patch for the same reason. +- Build with libmpeg2. + +------------------------------------------------------------------- +Sat Jun 2 23:32:45 UTC 2018 - bjorn.lie@gmail.com + +- Set to bcond_without gnome_vfs to bcond_with, no longer build + gnome-vfs support by default, gnome-vfs is deprecated upstream + for a long time. + +------------------------------------------------------------------- +Sat Jan 27 11:36:15 UTC 2018 - davejplater@gmail.com + +- Rebase fix-non-x86-build.diff to fix arm build. + +------------------------------------------------------------------- +Tue Jan 23 12:38:21 UTC 2018 - davejplater@gmail.com + +- Update to release 1.2.9 and add xine-lib-a52dec.patch. +- Moved xineplug_decode_mad and xineplug_decode_a52 into the main + package as they are now unrestricted. +- Enabled sdl and jack subpackages. +- Upstream changes: + * Add LIBXINE_VERBOSITY environment var override. + * Add auto gapless switch. Play clips to their very end when that + is likely what the user wants. + * Add video single step feature. + * Add generic keyframe index feature. + * Add x32 (x86 32 on 64bit) support. + * Add some more debug logging. + * Join 4 network input plugins into a single file. + * Matroska fixes. + * Build fixes. + * Directx2 audio fixes. + * VAAPI fixes. + * XCB video fixes and optimizations. + * Return driver held video frames on shutdown properly. + * FAAD audio compatibility fixes. + * Fix VP9 playback. + * Fix post filtering crash. + * Make xml parser thread safe. + * More user configuration safety. + * Inline assembly fixes. + * Failed memory allocation safety fixes. + * Memory leak fixes. + * Debug and LOG build fixes. + * Again, lots of small fixes and optimizations. + * Better multiengine client safety. + * Hide yuv2rgb implementation details. + * Use a single libyuv2rgb copy in both engine and plugins. + * Minor ffmpeg optimization. + * Lift a few video engine handbrakes. Less CPU load, fewer frame + drops, faster seeking. + * Optimize audio engine. + * Optimize demux buffering system. + * Optimize metronom clock. + * Optimize port tickets. + * Optimize sse/mmx2 memcpy. + * Code simplification and cleanup. + * Update german translation. + +------------------------------------------------------------------- +Mon Jan 22 15:36:18 UTC 2018 - crrodriguez@opensuse.org + +- Cleanup buildrequires so neither Mesa-devel nor xorg-x11-devel + meta/mega packages are required anymore. + +------------------------------------------------------------------- +Tue Aug 15 06:43:14 UTC 2017 - olaf@aepfle.de + +- Build unconditionally with modplug and pulseaudio + +------------------------------------------------------------------- +Thu Jul 6 10:15:58 UTC 2017 - olaf@aepfle.de + +- Remove dependency to gcc5 +- Use simple bcond for ffmpeg + +------------------------------------------------------------------- +Sun Apr 9 14:25:06 UTC 2017 - davejplater@gmail.com + +- Update to release 1.2.8 +- Remove patches fixed upstream: + xine-lib-crippled-ffmpeg3.0.patch, xine-lib-ffmpeg3.0.patch and + xine-lib-link-xcb.patch. +- Removed precheckin_cripple_tarball.sh and integrated it into the + spec file. +- Upstream changes: + * Add HEVC to QT demuxer. + * Add libOpenHEVC decoder. + * Add h.265/HEVC decoding to VAAPI. + * Detach VAAPI video out from ffmpeg. + * VAAPI fixes. + * Improved Matroska compatibility (TrueHD and PCM sound, + HDMV/Text subtitles). + * Add faad LATM support. + * Add faad preamp gain control and channel mixer. + * Update/fix internal libfaad. + * Integrate 6 basic plugins into libxine. + * ffmpeg fixes and optimizations. + * Use external libdvdnav by default. + * Optimize video out. + * AVFormat demuxer fixes. + * (XCB)XV video out fixes. + * Lots of small fixes and optimizations. + * Build fixes (newer automake, xcb, libdvdcss, dxr3, make dist, + 32+64bit dual install, gcc 4.x with GNU ld 2.26 ...). + * Better C++ compatibility. + * Add support for avi WAVE_FORMAT_EXTENSIBLE. + * Add "Time Domain Audio Analyzer" Visualization Post Plugin. + * Add support for compressed HDMV PGS subtitles in Matroska. + * Add HW accelerated OSD for Raspberry Pi. + * Add simple deep color (9/10bit) support via ffmpeg. + * Join 15 video demuxers into a single multiplugin lib. + * Join 5 vdpau decoders into a single multiplugin lib. + * Join 3 raw video decoders into a single multiplugin lib. + * Make ffmpeg/postproc optional. + * Log individual items when loading multiplugin libs. + * Improved qt/mp4 edit list handling. + * Detect mp3 files with large id3v2 tags. + * Auto recover from temporary DVB signal loss. + * Fix demuxing low framerate mp4. + * DVB AAC sound compatibility fix. + * ffmpeg audio downmix level fix and optimization. + * ffmpeg multithreading fixes. + * ffmpeg compatibility fixes. + * BluRay subtitle fixes. + * Various small fixes. + * OpenGL(2) video out fixes and optimizations. + * Fix some issues with heavy stream seeking. + * Build fixes, including missing vcd libs and much less warnings. + * Code simplifications. + +------------------------------------------------------------------- +Tue Mar 28 07:52:49 UTC 2017 - pgajdos@suse.com + +- fix build with ImageMagick 7 + + xine-lib-ImageMagick7.patch + +------------------------------------------------------------------- +Mon Aug 1 12:58:27 UTC 2016 - davejplater@gmail.com + +- Fixed build in Leap:42.2 by building with gcc5. +- Removed conditinals for old openSUSE versions from spec file. +- Modified pre checkin script to enable build with the ffmpeg libs + that are in the distribution. +- Added xine-lib-crippled-ffmpeg3.0.patch to enable leap and above + to build with ffmpeg3. +- Removed unused build flags. + +------------------------------------------------------------------- +Sun Jul 24 15:48:08 UTC 2016 - olaf@aepfle.de + +- Accept any ffmpeg version in BuildRequires + +------------------------------------------------------------------- +Mon Jul 18 13:47:07 UTC 2016 - dimstar@opensuse.org + +- Add xine-lib-link-xcb.patch: fix linking of libxcb. As our code + uses the functions, we must not rely on 3rd parties to hopefully + bring the right libraries to link. + https://bugs.xine-project.org/show_bug.cgi?id=573 + +------------------------------------------------------------------- +Fri Apr 15 12:18:02 UTC 2016 - dimstar@opensuse.org + +- Drop libsmbclient BuildRequires: requiring a library to build is + in any case wrong. It's the responsibility of a -devel package to + pull in the real libraries. + +------------------------------------------------------------------- +Fri Feb 26 15:12:34 UTC 2016 - joerg.lorenzen@ki.tng.de + +- Added xine-lib-ffmpeg3.0.patch to build against ffmpeg-3.0 + libraries on PMBS. +- Add pkgconfig(libva-glx) to BuildRequires because it's a separate + package for openSUSE > 13.2. + +------------------------------------------------------------------- +Mon Sep 21 06:40:47 UTC 2015 - olaf@aepfle.de + +- Replace implicit Requires from old ffmpeg with BuildRequires to + fix build in packman + +------------------------------------------------------------------- +Mon Feb 2 19:22:38 UTC 2015 - wbauer@tmo.at + +- update to 1.2.6 + * Add libmmal video output plugin for Raspberry Pi. + * Add libmmal HW video decoder plugin for Raspberry Pi. + * Add overlay colormatrix support. + * Add "sqare monitor pixels" config option. + * Add VAAPI colormatrix and fullrange video support. + * Add "radeonhd" XV colormatrix support. + * Add Opus audio support. + * Update german translation. + * Optimize OpenGL2 video out. + * Optimize raw RGB video decoder. + * Fix multithread ffmpeg video decoding. + * Fix/optimize DVB subtitles. + * Fix external text subtitles. + * BSD build fixes. + * Clang build fixes. + * Build optimization fixes (aliasing). + * AVformat demux build fix. + * More safety on memory allocation failure. + * Fix detection of and compilation with libcaca 0.99 beta 19. +- use the xz compressed tarball provided by upstream and change + precheckin_cripple_tarball.sh accordingly +- should fix boo#913588 + +------------------------------------------------------------------- +Fri Apr 11 00:00:00 UTC 2014 - Manfred.Tremmel@iiv.de + +- update to 1.2.5 + * Update german translation. + * Add bass downmix support to AC3 decoder. + * Add experimental YCgCo colorspace support. + * Add avformat demux plugin. + - Support for new formats and protocols. + - Proper rtsp support (with avformat+rtsp://, rtsp+tcp:// and rtsp+http:// mrls). + - by default native xine demux plugins are probed first. + This can be overridden in config, by selecting demuxer in mrl (#demux:avformat), + or by using "avformat+" mrl prefix. + * Add avio (libavformat) input plugin: + - Support for new protocols (https://, ftp://, sftp://, ...). + - Support for seekable http streams (with "avio+http://" mrl). + - By default native xine input plugins are used. This can be overridden in config or by using "avio+" mrl prefix. + * Recognise & use HEVC/H.265. (ffmpeg) + * Add support for HEVC/H.265 to the mpeg-ts demuxer. + * Add support for HEVC/H.265 and VP9 to the matroska demuxer. + * Add VP8/VP9 decoder using libvpx. + * Modernise Quicktime demuxer: + - Multiple user selectable audio traks. + - Support AC3, EAC3, vorbis, Purevoice audio. + - Support ISO fragment media files. + - More safety on broken files. + - Slightly faster. + * Recognise & use ADPCM G.726 and ATRAC3. (ffmpeg/libva) + * Build fixes. + * Fix HDMV subtitle channel. + * FFmpeg compatibility fixes. + * Some colour format conversion fixes. + * Fix RealVideo re-ordered PTS: pass through, let the decoder re-order it. + * Fix some problems with COOK audio. +- from 1.2.4 + * Some VAAPI plugin fixes (build, image size changes). + * ffmpeg multi-channel playback fixes: + - Handle channel configuration changes sooner. + - Generic layout if none provided; follow user changes. + - Defer opening output if nothing to play. + - Don't re-open with identical settings. + - Don't use the bits-per-sample value (may not match decoder output). + * ffmpeg video fixes: + - Default to square pixels, avoiding black bars & unnecessary scaling. + - Avoid CODEC_FLAG_EMU_EDGE (and some possible segfaults). + - Use MPEG2VIDEO. + * OpenGL2 output: don't render into invalid drawable. + * Fix a possible xine_play() hang related to display locking. + * FLV demuxer rewrite: + - Improved metadata parsing. + - PTS/DTS fixes. + - Large file support on 32-bit. + - Much improved seeking. + - Much optimisation. + - More codecs supported. + * audio_out speed control fixes. + * Optimised RGB→YUY2 conversion. + * Avoid a possible performance penalty where AVX-optimised memcpy is used. + * Add BD-J (BluRay Java) support with ARGB overlay capable video drivers (opengl2, vaapi, vdpau) + * Add support for theora 4:2:2 and 4:4:4 pixel formats +- Removed xine-lib-missing-include-1.2.3.patch, the missing file is now included in the upstream tarball + +------------------------------------------------------------------- +Wed Sep 11 13:19:26 UTC 2013 - pgajdos@suse.com + +- detect smbclient + +------------------------------------------------------------------- +Wed May 29 22:36:00 UTC 2013 - Manfred.Tremmel@iiv.de + +- update to 1.2.3 + * Add VAAPI HW decoding support + * Add OpenGL 2.0 output plugin + * Add crop support to XShm output plugins + * Add color matrix and full range support to OpenGL/Xv/XShm output plugins + * Add test image generator input plugin + * Add fast libjpeg based JPEG decoder + * Add max. Xv image size detection to Xv video output plugin + * Fix crash when trying to display too large jpeg image with Xv output plugin + * Fix possible crash when stopping playback with deinterlacing enabled + * Support large PAT in MPEG TS + * Handle EAC3 audio (via ffmpeg) + +------------------------------------------------------------------- +Fri Mar 1 06:14:15 UTC 2013 - coolo@suse.com + +- update license to new format + +------------------------------------------------------------------- +Wed Jul 18 10:54:59 UTC 2012 - davejplater@gmail.com + +- Added xine-lib-theora.patch to add fourcc code to xine + +------------------------------------------------------------------- +Thu Jun 21 07:58:03 UTC 2012 - adrian@suse.de + +- fix build for non-x86 architectures (disable deinterlace plugin) + +------------------------------------------------------------------- +Mon Jun 18 11:20:29 UTC 2012 - lnussel@suse.de + +- don't include .la files in libxine-devel to avoid bogus libtool errors + +------------------------------------------------------------------- +Thu Jun 14 20:20:01 UTC 2012 - coolo@suse.com + +- provide and obsolete xine-devel and xine-lib for backward compat + +------------------------------------------------------------------- +Sun Jun 10 14:45:00 UTC 2012 - Manfred.Tremmel@iiv.de + +- update to 1.2.2 + * Fix musepack decoder compilation if libmpcdec headers aren't available. + * Configure tests for xinerama & VideoCD support now soft-fail properly. + * The DVB plugin is working again. + * OpenGL OSD fix. + * YUV conversion MMX/SSE optimisations. + * YUV420 H.264 is playable now; YUVJ444P is correctly handled. + * Support FLAC in Matroska; support BMP. + * Various build fixes for Windows. + +------------------------------------------------------------------- +Wed Jun 06 21:17:00 UTC 2012 - Manfred.Tremmel@iiv.de + +- updated crippled version, removed mad and a52dec + +------------------------------------------------------------------- +Tue May 29 19:59:14 UTC 2012 - reddwarf@opensuse.org + +- Remove dependency from libxine-devel to libffmpeg-devel + +------------------------------------------------------------------- +Sat Feb 04 19:40:00 UTC 2012 - Manfred.Tremmel@iiv.de + +- update to 1.2.1 + * The "I'm at Tyneside LUG" release. + * Enable PulseAudio, JACK and VDPAU on the Hurd. + * Rewrite of VDPAU OSD handling. + * sndio plugin is now buildable. + * Various bug fixes. + +------------------------------------------------------------------- +Fri Jan 06 11:06:00 UTC 2012 - Manfred.Tremmel@iiv.de + +- first build of xine-lib-12 for packman + diff --git a/xine-lib.spec b/xine-lib.spec new file mode 100644 index 0000000..61853a0 --- /dev/null +++ b/xine-lib.spec @@ -0,0 +1,749 @@ +# +# spec file for package xine-lib +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: xine-lib +# %%bcond_with = default off +# %%bcond_without = default on +# +# --with distributable -> don't build libxine2-codecs +# --without distributable -> build libxine2-codecs +# +# default for buildservice is no patented codecs +%bcond_without distributable +%bcond_with onlynondistributable +%if 0%{?suse_version} > 1320 +BuildRequires: gcc +BuildRequires: pkgconfig(libmpeg2) +%else +BuildRequires: gcc8 +%endif +%bcond_without sdl +%bcond_without jack +# +BuildRequires: ImageMagick-devel +BuildRequires: alsa-devel +BuildRequires: flac-devel +BuildRequires: giflib-devel +BuildRequires: glib2-devel +BuildRequires: gnutls-devel +BuildRequires: gtk2-devel +BuildRequires: imlib2-devel +BuildRequires: krb5-devel +BuildRequires: libcdio-devel +BuildRequires: libdrm-devel +BuildRequires: libmng-devel +BuildRequires: libmpcdec-devel +BuildRequires: libtheora-devel +BuildRequires: libtool +BuildRequires: libv4l-devel >= 0.8.4 +BuildRequires: libvorbis-devel +BuildRequires: lirc-devel +BuildRequires: perl +BuildRequires: readline-devel +BuildRequires: speex-devel +BuildRequires: update-desktop-files +BuildRequires: vcdimager-devel +BuildRequires: pkgconfig(dvdnav) +BuildRequires: pkgconfig(egl) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(liba52) +#Prevent building against ffmpeg 3 +BuildRequires: pkgconfig(libavcodec) >= 58 +BuildRequires: pkgconfig(libavformat) >= 58 +BuildRequires: pkgconfig(libavutil) >= 56 +BuildRequires: pkgconfig(libbluray) +BuildRequires: pkgconfig(libpostproc) >= 55 +BuildRequires: pkgconfig(mad) +BuildRequires: pkgconfig(smbclient) +BuildRequires: pkgconfig(vpx) +BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(xcb-shape) +BuildRequires: pkgconfig(xcb-shm) +BuildRequires: pkgconfig(xcb-xv) +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xv) +BuildRequires: pkgconfig(xvmc) +BuildRequires: pkgconfig(zlib) +%if %{without distributable} +BuildRequires: libfaad-devel +BuildRequires: pkgconfig(glesv2) +BuildRequires: pkgconfig(libdts) +BuildRequires: pkgconfig(libva) +BuildRequires: pkgconfig(libva-glx) +BuildRequires: pkgconfig(vdpau) +%endif +BuildRequires: libpulse-devel +%if %{with sdl} +BuildRequires: pkgconfig(sdl) +%endif +%if %{with jack} +BuildRequires: libjack-devel +%endif +BuildRequires: libmodplug-devel +Version: 1.2.13 +Release: 0 +%define abiversion 2.11 +Summary: Video Player with Plug-Ins +License: GPL-2.0-or-later AND SUSE-Public-Domain +Group: Productivity/Multimedia/Video/Players +URL: https://www.xine-project.org/ +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +Source: http://sourceforge.net/projects/xine/files/%{name}/%{version}/%{name}-%{version}.tar.xz +Source1: baselibs.conf + +Patch0: xine-lib-libdvdread_udf.diff +Patch1: xine-lib-v4l-2.6.38.patch +# Add theora FOURCC to libxine I found an avi container that xine wouldn't play. +Patch4: xine-lib-theora.patch +# PATCH-FIX-UPSTREAM xine-lib-configure-c99.patch - boo#1225957 +Patch5: xine-lib-configure-c99.patch +# PATCH-FIX-UPSTREAM ffmpeg-7 compatibility +Patch6: xine-lib-ffmpeg-7.patch + +%description +

Great video and multimediaplayer, supports DVD, MPEG, AVI, DivX, VCD, Quicktime ...

You need a frontend for xine-lib like xine-ui, gxine, kaffeine or totem.

Since 1-rc6 the package number is reduced, all you may miss, is in the base package

If you want to play css encrypted Video-DVD's, you need to install libdvdcss.

+ +%description -l de +

Großartiger Video- und Multimediaplayer mit Support für DVD, MPEG, AVI, DivX, VCD,Quicktime ...

Bitte beachten Sie, dass Sie neben der xine-lib auch eine Bedienoberfläche wie xine-ui, gxine, kaffeine oder totem benötigen.

Seit 1-rc6 wurde die Zahl der Pakete reduziert, alles was sie eventuell vermissen, wurde in das Basispaket integriert.

Wenn Sie css verschlüsselte Video-DVDs abspielen wollen, müssen Sie zusätzlich die libdvdcss installieren.

+ +%package -n libxine2 +Summary: Video Player with Plug-Ins +License: GPL-2.0-or-later +Group: Productivity/Multimedia/Video/Players +Provides: libxine2-syncfb = %{version}-%{release} +Obsoletes: libxine2-syncfb < %{version}-%{release} +Provides: libxine2-xvmc = %{version}-%{release} +Obsoletes: libxine2-xvmc < %{version}-%{release} +Provides: libxine2-dvb = %{version}-%{release} +Obsoletes: libxine2-dvb < %{version}-%{release} +Provides: %{name} = %{version}-%{release} +Obsoletes: %{name} < %{version}-%{release} +Recommends: libxine2-codecs = %{version} +Recommends: opensuse-codecs-installer + +%description -n libxine2 +xine is a video player with a graphical front-end that supports a large +number of file formats (VCD and MPEG2, for example) using plug-ins. +Several plug-ins are included. Others can be installed after xine +installation. xine supports stereo sound using OSS and AC5.1 using +Alsa. + +%if %{with distributable} +This version of xine may lack certain features because of legal +requirements (potential patent violation). See also +http://en.opensuse.org/XINE#Legal_Matters +%endif + +More information about xine plug-ins can be found at +http://www.xine-project.org/home + +Authors: +-------- + Guenter Bartsch + +%description -n libxine2 -l de +xine ist ein Videoplayer mit grafischem Frontend und unterstützt +eine vielzahl an Dateiformaten (z.B. VCD und MPEG2) mit hilfe von +Plugins. Einige Plugins sind enthalten, andere können nach der +Installation von xine nachinstalliert werden. xine untersützt +Stereosound via OSS und AC5.1 per Alsa. + +%if %{with distributable} +Diese xine-Version lässt eventuell einige Funktione aus rechtlichen +Gründen vermissen (mögliche Patentverletzungen). Siehe dazu +http://en.opensuse.org/XINE#Legal_Matters +%endif + +Weitere Informationen über xine Plugins finden Sie unter +http://www.xine-project.org/home + +Autoren: +-------- + Guenter Bartsch + +%package -n libxine-devel +Summary: Development environment for xine-based media players +License: GPL-2.0-or-later AND SUSE-Public-Domain +Group: Development/Libraries/C and C++ +Requires: freetype2-devel +Requires: glibc-devel +Requires: libv4l-devel +Requires: libxine2 = %{version} +Requires: zlib-devel +Obsoletes: libxine2-devel < %{version}-%{release} +Provides: libxine2-devel = %{version}-%{release} +Obsoletes: xine-lib2-devel < %{version}-%{release} +Provides: xine-lib2-devel = %{version}-%{release} +Obsoletes: xine-devel < %{version}-%{release} +Provides: xine-devel = %{version}-%{release} + +%description -n libxine-devel +This package contains all necessary include files, libraries and +configuration files needed to compile applications that use the xine +media player. + +xine is a video player which supports a large number of file formats +(i.e., VCD, MPEG2) using plug-ins. Several plug-ins are included. +Others can be post-installed. Supports stereo sound using OSS and AC5.1 +using Alsa. + +%if %{with distributable} +This version of xine may lack certain features because of legal +requirements (potential patent violation). See also +http://en.opensuse.org/XINE#Legal_Matters +%endif + +More information about xine plug-ins can be found at +http://www.xine-project.org/home + +Authors: +-------- + Guenter Bartsch + +%description -n libxine-devel -l de +Dieses Paket enthält alle nötigen Include Dateien, Biblioteken und +Konfigurationsdateien, die benötigt werden, um Anwendungen zu +kompilieren, die den xine Media Player verwenden. + +xine ist ein Videoplayer mit grafischem Frontend und unterstützt +eine vielzahl an Dateiformaten (z.B. VCD und MPEG2) mit hilfe von +Plugins. Einige Plugins sind enthalten, andere können nach der +Installation von xine nachinstalliert werden. xine untersützt +Stereosound via OSS und AC5.1 per Alsa. + +%if %{with distributable} +Diese xine-Version lässt eventuell einige Funktione aus rechtlichen +Gründen vermissen (mögliche Patentverletzungen). Siehe dazu +http://en.opensuse.org/XINE#Legal_Matters +%endif + +Weitere Informationen über xine Plugins finden Sie unter +http://www.xine-project.org/home + +Autoren: +-------- + Guenter Bartsch + +%package -n libxine2-pulse +Summary: Pulseaudio plugin for xine +License: GPL-2.0-or-later AND SUSE-Public-Domain +Group: Productivity/Multimedia/Video/Players +Requires: libxine2 = %{version} +Supplements: packageand(libpulse0:libxine2) + +%description -n libxine2-pulse +libxine sound output plugin for the pulseaudio soundserver + + + +Authors: +-------- + Guenter Bartsch + +%description -n libxine2-pulse -l de +libxine Soundausgabeplugin für den Pulseaudio Soundserver + + + +Autoren: +-------- + Guenter Bartsch + +%if %{with sdl} + +%package -n libxine2-sdl +Summary: SDL plugin for xine +License: GPL-2.0-or-later AND SUSE-Public-Domain +Group: Productivity/Multimedia/Video/Players +Requires: libxine2 = %{version} + +%description -n libxine2-sdl +SDL xine video output plugin + + + +Authors: +-------- + Guenter Bartsch + +%description -n libxine2-sdl -l de +SDL xine Video-Ausgabeplugin + + + +Autoren: +-------- + Guenter Bartsch +%endif + +%if %{with jack} + +%package -n libxine2-jack +Summary: Jack plugin for xine +License: GPL-2.0-or-later AND SUSE-Public-Domain +Group: Productivity/Multimedia/Video/Players +Requires: libxine2 = %{version} + +%description -n libxine2-jack +xine sound output plugin for the jack soundserver + + + +Authors: +-------- + Guenter Bartsch + +%description -n libxine2-jack -l de +xine Soundausgabeplugin für den jack Soundserver + + + +Autoren: +-------- + Guenter Bartsch +%endif + +%if %{without distributable} + +%package -n libxine2-codecs +# these libs are possibly illegal and may not work without libdvdcss anyway +Summary: Xine plugins for watching DVDs, DivX and more +License: GPL-2.0-or-later AND SUSE-Public-Domain +Group: Productivity/Multimedia/Video/Players +Requires: libxine2 = %{version} +Provides: libxine2-dvd = %{version}-%{release} +Obsoletes: libxine2-dvd < %{version}-%{release} +Provides: libxine2-dxr3 = %{version}-%{release} +Obsoletes: libxine2-dxr3 < %{version}-%{release} +%ifarch %{ix86} +Provides: libxine2-w32dll = %{version}-%{release} +Obsoletes: libxine2-w32dll < %{version}-%{release} +%endif +Recommends: libdvdcss2 >= 1.2.10 + +%description -n libxine2-codecs +With these xine plug-ins, you can watch DVDs and all other kind of +media using xine. More information about xine plug-ins can be found at +http://www.xine-project.org/home + + + +Authors: +-------- + Guenter Bartsch + +%description -n libxine2-codecs -l de +Mit diesem xine Plugins können Sie DVDs und alle von xine unterstützten +Medienverainten abspielen. Weitere Informationtne über xine Plugins +finden Sie unter +http://www.xine-project.org/home + + + +Autoren: +-------- + Guenter Bartsch +%endif + +%prep +%if %{with distributable} && %{with onlynondistributable} +%error need --without distributable for --with onlynondistributable +%endif +%autosetup -p1 -n %{name}.%{version} + +%build +cat <; for $e (qw|'"$2"'|) { s|(?<=[^-a-zA-Z0-9_./])'"$3"'$e'"$4"'(?=[^-a-zA-Z0-9_./])||g }; print' ${d} +done +} + +do_nukeentrynp() { +for i in ${2};do + cat ${1}|grep -v ${i} >${1}n;mv ${1}n ${1} +done +} + +# $1: files $2: entries $3: prefix $4: postfix +do_nukeline() { +for d in $1 ; do + perl -i -e 'undef $/; $_=<>; for $e (qw|'"$2"'|) { s|^.*(?<=[^-a-zA-Z0-9_./])'"$3"'$e'"$4"'(?=[^-a-zA-Z0-9_./]).*$||mg }; print' $d +done +} + +# $1: dir $2: files/dirs +do_remove() { +pushd "$1" >/dev/null || exit 1 +rm -rf $2 +popd >/dev/null +} + +# Cripple source +# +# combined/ffmpeg +echo 1>&2 "Crippling..." + +c_subdirs="faad planar dxr3 asf dmx_video libdts libfaad libffmpeg libspucc libspudec libspudvb libw32dll" +c_demuxers="group_video.c demux_elem.c xineplug_dmx_asf.la asfheader.h asfheader.c demux_asf.c xineplug_dmx_mpeg.la demux_mpeg.c xineplug_dmx_mpeg_block.la demux_mpeg_block.c xineplug_dmx_mpeg_ts.la demux_ts.c xineplug_dmx_mpeg_elem.la demux_elem.c xineplug_dmx_mpeg_pes.la demux_mpeg_pes.c xineplug_dmx_yuv4mpeg2.la demux_yuv4mpeg2.c" +c_input="xineplug_inp_mms.la input_mms.c mms.c mmsh.c ../demuxers/asfheader.c mms.h mmsh.h" +c_libxineadec="xineplug_decode_gsm610.la xineplug_decode_nsf.la gsm610.c nsf.c gsm610 nosefart" +c_post="planar pp_module PLANAR" + +do_nukeentry src/Makefile.am "$c_subdirs" +do_nukeentry configure.ac "$c_subdirs" "src/" "/[a-zA-Z0-9_./]*Makefile" +do_remove src "$c_subdirs" +do_nukeentry src/demuxers/Makefile.am "$c_subdirs" +do_nukeentry contrib/Makefile.am "$c_subdirs" +do_nukeentry src/demuxers/Makefile.am "$c_demuxers" +do_remove src/demuxers "$c_demuxers" +do_nukeentry src/input/Makefile.am "$c_input" +do_remove src/input "$c_input" +#do_nukeentry src/audio_dec/Makefile.am "$c_audiodec" +#do_remove src/audio_dec "$c_audiodec" +#do_nukeentry src/combined/Makefile.am "ffmpeg" +#do_remove src/combined "ffmpeg" +do_nukeentrynp src/post/Makefile.am "$c_post" +#do_nukeline src/post/planar/planar.c "pp_init_plugin pp_special_info" +do_remove src/post "planar" +sed -i 's@libfaad@@g' contrib/Makefile.am +%endif + +rm -f m4/libtool15.m4 +sed -i -e 's|/tmp/vdr-xine|/var/lib/vdr-xine|g' src/vdr/input_vdr.c + +export CFLAGS="%{optflags} -fno-strict-aliasing -fno-force-addr `pkg-config --cflags smbclient`" +export CCASFLAGS=-Wa,--noexecstack +test -x "$(type -p gcc-7)" && export CC="$_" +test -x "$(type -p gcc-8)" && export CC="$_" +echo 'AC_DEFUN([AC_REQUIRE_AUX_FILE])dnl' >> acinclude.m4 + +#rm -f configure +#if [ ! -f configure ]; then +./autogen.sh noconfig +#else +#AUTOPOINT=true autoreconf -fi +#fi + +%configure \ + --disable-rpath \ + --docdir=%{_defaultdocdir}/xine \ + --enable-antialiasing \ + --with-libflac \ + --with-freetype \ + --enable-v4l \ + --enable-modplug \ +%if %{without sdl} + --without-sdl \ +%endif +%if %{with distributable} + --disable-faad \ + --disable-vdpau \ + --disable-dxr3 \ + --disable-asf \ +%else + --enable-dxr3 \ +%endif +%ifarch %{ix86} + --with-w32-path=/usr/lib/win32 \ +%endif + --with-pic \ + --with-external-dvdnav +# --disable-libxine-builtins +# --with-install-plugins-helper=${_prefix}/lib/opensuse-codecs-installer +echo $CFLAGS +make %{?jobs:-j%{jobs}} V=1 + +%install +make install DESTDIR=%{buildroot} +LIB="%{buildroot}%{_libdir}/xine/plugins/%{abiversion}" +# install documentation +#install -m 0644 %%{SOURCE1} COPYING AUTHORS %%{buildroot}%%{_defaultdocdir}/xine/ +# remove usless READMEs +rm %{buildroot}%{_defaultdocdir}/xine/README.{irix,solaris,WIN32} +# remove .la files, they are evil +rm %{buildroot}%{_libdir}/*.la +rm -f files +%ifarch %{ix86} + mkdir -p %{buildroot}/usr/lib/win32 +%endif +%if %{with distributable} +rm -rf %{buildroot}%{_libdir}/xine/plugins/%{abiversion}/post +rm -f %{buildroot}%{_libdir}/xine/plugins/%{abiversion}/xineplug_dmx_video.so +%endif +# +# big plugin sorting + # +cat > plugins << EOF +# these plugins do not have legal problems +xineplug_tls_gnutls +xineplug_ao_out_alsa +xineplug_ao_out_oss +xineplug_vo_out_fb +xineplug_vo_gl_egl_x11 +xineplug_vo_gl_glx +xineplug_vo_out_opengl +xineplug_vo_out_opengl2 +xineplug_vo_out_xshm +xineplug_vo_out_xv +xineplug_vo_out_xcbshm +xineplug_vo_out_xcbxv +xineplug_vo_out_raw +xineplug_decode_mad +xineplug_decode_a52 +xineplug_decode_to_spdif +%if %{without distributable} +xineplug_vo_out_vdpau +xineplug_vo_gl_egl_wl +%endif +xineplug_inp_dvb +xineplug_inp_dvd +xineplug_inp_v4l +xineplug_inp_v4l2 +xineplug_inp_network +xineplug_inp_cdda +xineplug_inp_smb +xineplug_inp_pvr +xineplug_inp_rtp +#New in 1.2.7 +xineplug_decode_rawvideo +xineplug_decode_libpng +%if %{without distributable} +xineplug_decode_vdpau +post/xineplug_post_audio_filters +post/xineplug_post_goom +post/xineplug_post_mosaico +post/xineplug_post_switch +post/xineplug_post_tvtime +post/xineplug_post_visualizations +xineplug_dmx_video +%endif +#end new +xineplug_decode_lpcm +xineplug_decode_real +xineplug_decode_mpc +xineplug_decode_gdk_pixbuf +xineplug_decode_spucmml +xineplug_decode_spuhdmv +xineplug_decode_libjpeg +xineplug_decode_image +xineplug_decode_libvpx +xineplug_dmx_audio +xineplug_dmx_image +xineplug_dmx_fli +xineplug_dmx_nsv +xineplug_dmx_mng +xineplug_dmx_pva +xineplug_dmx_games +xineplug_dmx_slave +xineplug_dmx_modplug +xineplug_dmx_playlist +xineplug_flac +xineplug_sputext +xineplug_xiph +xineplug_vdr +xineplug_vo_out_xxmc +xineplug_vo_out_xvmc +%ifarch %{ix86} +xineplug_vo_out_vidix +vidix/cyberblade_vid +vidix/mach64_vid +vidix/mga_crtc2_vid +vidix/mga_vid +vidix/nvidia_vid +vidix/pm2_vid +vidix/pm3_vid +vidix/radeon_vid +vidix/rage128_vid +vidix/savage_vid +vidix/sis_vid +vidix/unichrome_vid +%endif +# +.pulse +xineplug_ao_out_pulseaudio +# +.jack +xineplug_ao_out_jack +# +.sdl +xineplug_vo_out_sdl +# +# +.codecs +# libmad and MPEG related plugins +xineplug_decode_spudvb +xineplug_inp_vcd +xineplug_inp_vcdo +xineplug_decode_mpeg2 +# these plugins do have legal problems +xineplug_decode_dts +xineplug_decode_faad +xineplug_decode_ff +xineplug_decode_dvaudio +xineplug_dmx_asf +xineplug_inp_mms +xineplug_inp_bluray +# I am not sure about these plugins, they need to be checked +# Closed Captioning Decoder (EIA-608). Patented ??? +xineplug_decode_spucc +xineplug_decode_spu +# NES Music File Format. free ?? +xineplug_nsf +# Philips claimed intellectual property on GSM 06.10 +xineplug_decode_gsm610 +%ifarch %{ix86} +xineplug_decode_w32dll +%endif +xineplug_dxr3 +xineplug_vo_out_vaapi +xineplug_hw_frame_vaapi +xineplug_va_display_drm +xineplug_va_display_glx +xineplug_va_display_wl +xineplug_va_display_x11 +# unfortunately using external ffmpeg links the planar post +# processing plugin against ffmpeg libs +post/xineplug_post_planar +# +EOF +# +OUT_FILE="" +grep -v ^# plugins | while read i; do + [ "${i:0:1}" = "." ] && OUT_FILE=${i} && continue + echo %{_libdir}/xine/plugins/%{abiversion}/${i}.so >> files${OUT_FILE} +done +%find_lang libxine2 +cat libxine2.lang >>files +%if %{with distributable} +xargs -i+ rm -f %{buildroot}/+