Here is an update to Xine-lib 1.2.13.
xine-lib (1.2.13) 2023-01-25 * 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. Index: Makefile =================================================================== RCS file: /home/cvs/ports/multimedia/xine-lib/Makefile,v retrieving revision 1.155 diff -u -p -u -p -r1.155 Makefile --- Makefile 3 Apr 2022 11:12:09 -0000 1.155 +++ Makefile 29 Jan 2023 01:02:13 -0000 @@ -1,12 +1,11 @@ COMMENT= multimedia decoding library -DISTNAME= xine-lib-1.2.12 -REVISION= 2 +DISTNAME= xine-lib-1.2.13 CATEGORIES= multimedia MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=xine/} EXTRACT_SUFX= .tar.xz -SHARED_LIBS= xine 37.0 +SHARED_LIBS= xine 38.0 HOMEPAGE= https://www.xine-project.org/ @@ -26,7 +25,7 @@ WANTLIB += v4lconvert vcdinfo vorbis vor WANTLIB += xcb-dri3 xcb-glx xcb-present xcb-shape xcb-shm xcb-sync WANTLIB += xcb-xfixes xcb-xv xdg-basedir xml2 xshmfence xvidcore z -XINEAPI_REV= 2.10 +XINEAPI_REV= 2.11 SUBST_VARS+= XINEAPI_REV COMPILER= base-clang ports-gcc @@ -61,8 +60,6 @@ CFLAGS+= -ffast-math MAKE_ENV= V=1 -FIX_CRLF_FILES= src/demuxers/asfheader.c - USE_GMAKE= Yes CONFIGURE_STYLE= autoconf AUTOCONF_VERSION= 2.69 @@ -94,9 +91,6 @@ CONFIGURE_ENV= CPPFLAGS="-I${X11BASE}/in LDFLAGS="-L${X11BASE}/lib -L${LOCALBASE}/lib" NO_TEST= Yes - -pre-configure: - sed -i 's/__u32/u_int32_t/' ${WRKSRC}/src/input/input_pvr.c post-install: @find ${PREFIX}/lib/xine/plugins -name '*.a' -delete Index: distinfo =================================================================== RCS file: /home/cvs/ports/multimedia/xine-lib/distinfo,v retrieving revision 1.33 diff -u -p -u -p -r1.33 distinfo --- distinfo 13 Mar 2022 13:55:09 -0000 1.33 +++ distinfo 29 Jan 2023 01:02:34 -0000 @@ -1,2 +1,2 @@ -SHA256 (xine-lib-1.2.12.tar.xz) = 1gYnBGjhVAwqicDX9f3xHhfswMJpjMC8sQZf8mq+4Jg= -SIZE (xine-lib-1.2.12.tar.xz) = 5341212 +SHA256 (xine-lib-1.2.13.tar.xz) = XxDW1xikpRwX7RsysDHU+bgLBh6CdlNbK+MeWsS3Xm8= +SIZE (xine-lib-1.2.13.tar.xz) = 5004196 Index: patches/patch-configure_ac =================================================================== RCS file: /home/cvs/ports/multimedia/xine-lib/patches/patch-configure_ac,v retrieving revision 1.24 diff -u -p -u -p -r1.24 patch-configure_ac --- patches/patch-configure_ac 11 Mar 2022 19:39:29 -0000 1.24 +++ patches/patch-configure_ac 26 Jan 2023 05:14:37 -0000 @@ -1,7 +1,7 @@ Index: configure.ac --- configure.ac.orig +++ configure.ac -@@ -888,9 +888,7 @@ AC_ARG_ENABLE([optimizations], +@@ -933,9 +933,7 @@ AC_ARG_ENABLE([optimizations], [AS_HELP_STRING([--disable-optimizations], [Don't try to guess what optimization to enable])], [], [test x"$enable_debug" != x"no" && enable_optimizations="no"]) AM_CONDITIONAL([DISABLE_OPTIMIZATIONS], [test x"$enable_optimizations" = x"no"]) @@ -12,7 +12,7 @@ Index: configure.ac dnl For multi-pass compilation: never when cross-compiling if test x"$cross_compiling" != x"yes"; then if test x"$GCC" = x"yes"; then -@@ -911,7 +909,7 @@ AC_SUBST(O0_CFLAGS) +@@ -956,7 +954,7 @@ AC_SUBST(O0_CFLAGS) AC_SUBST(PASS1_CFLAGS) AC_SUBST(PASS2_CFLAGS) @@ -21,7 +21,7 @@ Index: configure.ac dnl xineutils.h:dlist_* -@@ -1324,9 +1322,9 @@ t q +@@ -1369,9 +1367,9 @@ t q b :q q" Index: patches/patch-src_combined_ffmpeg_ff_video_decoder_c =================================================================== RCS file: patches/patch-src_combined_ffmpeg_ff_video_decoder_c diff -N patches/patch-src_combined_ffmpeg_ff_video_decoder_c --- patches/patch-src_combined_ffmpeg_ff_video_decoder_c 3 Apr 2022 11:12:10 -0000 1.27 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,95 +0,0 @@ -- Drop always true check - b1ecb15deaf85079b3543b8b27f876abe580acd9 -- Drop redundant flag - 584638837b26fb35ec4ce082304e2943af51072d -- Check for NULL - fc5c2dde344ea039391e111bd7b0d5ab8198a544 - -Index: src/combined/ffmpeg/ff_video_decoder.c ---- src/combined/ffmpeg/ff_video_decoder.c.orig -+++ src/combined/ffmpeg/ff_video_decoder.c -@@ -127,7 +127,6 @@ struct ff_video_decoder_s { - - uint8_t decoder_ok:1; - uint8_t decoder_init_mode:1; -- uint8_t is_mpeg12:1; - #ifdef HAVE_POSTPROC - uint8_t pp_available:1; - #endif -@@ -1699,7 +1698,7 @@ static int ff_vc1_find_header(ff_video_decoder_t *this - - static int ff_check_extradata(ff_video_decoder_t *this, unsigned int codec_type, buf_element_t *buf) - { -- if (this->context && this->context->extradata) -+ if (this->context->extradata) - return 1; - - switch (codec_type) { -@@ -1713,8 +1712,6 @@ static int ff_check_extradata(ff_video_decoder_t *this - - static void ff_init_mpeg12_mode(ff_video_decoder_t *this) - { -- this->is_mpeg12 = 1; -- - if (this->decoder_init_mode) { - _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, - "mpeg-1 (ffmpeg)"); -@@ -1725,7 +1722,8 @@ static void ff_init_mpeg12_mode(ff_video_decoder_t *th - - if ( this->mpeg_parser == NULL ) { - this->mpeg_parser = calloc(1, sizeof(mpeg_parser_t)); -- mpeg_parser_init(this->mpeg_parser, AV_INPUT_BUFFER_PADDING_SIZE); -+ if (this->mpeg_parser) -+ mpeg_parser_init(this->mpeg_parser, AV_INPUT_BUFFER_PADDING_SIZE); - } - } - -@@ -1739,7 +1737,7 @@ static void ff_handle_preview_buffer (ff_video_decoder - ff_init_mpeg12_mode(this); - } - -- if (this->decoder_init_mode && !this->is_mpeg12) { -+ else if (this->decoder_init_mode && !this->mpeg_parser) { - - if (!ff_check_extradata(this, codec_type, buf)) - return; -@@ -2066,9 +2064,12 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_ - - lprintf("handle_mpeg12_buffer\n"); - -- if (!this->is_mpeg12) { -+ if (!this->mpeg_parser) { - /* initialize mpeg parser */ - ff_init_mpeg12_mode(this); -+ if (!this->mpeg_parser) { -+ return; -+ } - } - - #ifdef DEBUG_MPEG_PARSER -@@ -2653,7 +2654,7 @@ static void ff_decode_data (video_decoder_t *this_gen, - } - - } else { -- if (this->decoder_init_mode && !this->is_mpeg12) -+ if (this->decoder_init_mode) - ff_handle_preview_buffer(this, buf); - - /* decode */ -@@ -2875,7 +2876,7 @@ static void ff_reset (video_decoder_t *this_gen) { - #endif - } - -- if (this->is_mpeg12) -+ if (this->mpeg_parser) - mpeg_parser_reset(this->mpeg_parser); - - /* this->pts_tag_pass = 0; */ -@@ -2997,7 +2998,6 @@ static video_decoder_t *ff_video_open_plugin (video_de - #ifndef HAVE_ZERO_SAFE_MEM - this->size = 0; - this->decoder_ok = 0; -- this->is_mpeg12 = 0; - this->aspect_ratio = 0; - this->pts_tag_pass = 0; - #ifdef HAVE_POSTPROC Index: patches/patch-src_demuxers_asfheader_c =================================================================== RCS file: patches/patch-src_demuxers_asfheader_c diff -N patches/patch-src_demuxers_asfheader_c --- patches/patch-src_demuxers_asfheader_c 25 Mar 2022 09:42:38 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -Fix freeing uninitialized pointer (error path) -bf940cd3fc5773a1dd63ff52657a3829cf31f80f - -Index: src/demuxers/asfheader.c ---- src/demuxers/asfheader.c.orig -+++ src/demuxers/asfheader.c -@@ -415,7 +415,7 @@ static int asf_header_parse_stream_extended_properties - - /* get stream names */ - if (asf_stream_extension->stream_name_count) { -- asf_stream_extension->stream_names = malloc (asf_stream_extension->stream_name_count * sizeof (void*)); -+ asf_stream_extension->stream_names = calloc (asf_stream_extension->stream_name_count, sizeof (void*)); - for (i = 0; i < asf_stream_extension->stream_name_count; i++) { - char *name; - uint16_t length; Index: patches/patch-src_demuxers_demux_qt_c =================================================================== RCS file: patches/patch-src_demuxers_demux_qt_c diff -N patches/patch-src_demuxers_demux_qt_c --- patches/patch-src_demuxers_demux_qt_c 24 Mar 2022 16:28:53 -0000 1.21 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@ -Fix .mp4 audio. -1d19ee27ae88f12ac9b52b6538834a3a9a6b7c29 - -Index: src/demuxers/demux_qt.c ---- src/demuxers/demux_qt.c.orig -+++ src/demuxers/demux_qt.c -@@ -1225,14 +1225,34 @@ static qt_error parse_trak_atom (qt_trak *trak, uint8_ - /* in mp4 files the audio fourcc is always 'mp4a' - the codec is - * specified by the object type id field in the esds atom */ - if (p->codec_fourcc == MP4A_FOURCC) { -+ static const uint8_t atag_index[256] = { -+ [0x40] = 0, /* AAC, MP4ALS */ -+ [0x66] = 0, /* MPEG2 AAC Main */ -+ [0x67] = 0, /* MPEG2 AAC Low */ -+ [0x68] = 0, /* MPEG2 AAC SSR */ -+ [0x69] = 1, /* MP3 13818-3, MP2 11172-3 */ -+ [0x6B] = 1, /* MP3 11172-3 */ -+ [0xA5] = 2, /* AC3 */ -+ [0xA6] = 3, /* EAC3 */ -+ [0xA9] = 4, /* DTS mp4ra.org */ -+ [0xDD] = 5, /* Vorbis non standard, gpac uses it */ -+ [0xE1] = 6, /* QCELP */ -+ }; -+ static const struct { -+ uint32_t buftype; -+ char name[8]; -+ } atag_info[7] = { -+ [0] = { BUF_AUDIO_AAC, "aac" }, /** << note: using this as default. */ -+ [1] = { BUF_AUDIO_MPEG, "mp3" }, -+ [2] = { BUF_AUDIO_A52, "ac3" }, -+ [3] = { BUF_AUDIO_EAC3, "eac3" }, -+ [4] = { BUF_AUDIO_DTS, "dts" }, -+ [5] = { BUF_AUDIO_VORBIS, "vorbis" }, -+ [6] = { BUF_AUDIO_QCLP, "qcelp" }, -+ }; - p->s.audio.vbr = 1; -- if (p->object_type_id == 221) { -- p->codec_buftype = BUF_AUDIO_VORBIS; -- memcpy (p->codec_str, "vorbis", 7); -- } else if (p->object_type_id == 107) { -- p->codec_buftype = BUF_AUDIO_MPEG; -- memcpy (p->codec_str, "mp3", 4); -- } -+ p->codec_buftype = atag_info[atag_index[p->object_type_id & 255]].buftype; -+ strcpy (p->codec_str, atag_info[atag_index[p->object_type_id & 255]].name); - } - /* if this is MP4 audio, mark the trak as VBR */ - else if ((p->codec_fourcc == SAMR_FOURCC) || Index: patches/patch-src_demuxers_demux_smjpeg_c =================================================================== RCS file: patches/patch-src_demuxers_demux_smjpeg_c diff -N patches/patch-src_demuxers_demux_smjpeg_c --- patches/patch-src_demuxers_demux_smjpeg_c 25 Mar 2022 09:42:38 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,68 +0,0 @@ -- Use int64_t when calculating pts - 7fd1885d7c3be202ed48609ee3f63ed1b642df9f -- Fix use-after-free - af586f66a0d446c2ca9d3967a4fcdd534dbd0759 - -Index: src/demuxers/demux_smjpeg.c ---- src/demuxers/demux_smjpeg.c.orig -+++ src/demuxers/demux_smjpeg.c -@@ -75,6 +75,7 @@ typedef struct { - /* video information */ - unsigned int video_type; - xine_bmiheader bih; -+ int64_t last_frame_pts; - - /* audio information */ - unsigned int audio_type; -@@ -194,7 +195,6 @@ static int demux_smjpeg_send_chunk(demux_plugin_t *thi - unsigned int remaining_sample_bytes; - unsigned char preamble[SMJPEG_CHUNK_PREAMBLE_SIZE]; - off_t current_file_pos; -- int64_t last_frame_pts = 0; - unsigned int audio_frame_count = 0; - - /* load the next sample */ -@@ -228,9 +228,7 @@ static int demux_smjpeg_send_chunk(demux_plugin_t *thi - * Therefore, manually compute the pts values for the audio samples. - */ - if (chunk_tag == sndD_TAG) { -- pts = audio_frame_count; -- pts *= 90000; -- pts /= (this->audio_sample_rate * this->audio_channels); -+ pts = INT64_C(90000) * audio_frame_count / ((int64_t)this->audio_sample_rate * this->audio_channels); - audio_frame_count += ((remaining_sample_bytes - 4) * 2); - } else { - pts = _X_BE_32(&preamble[4]); -@@ -255,12 +253,12 @@ static int demux_smjpeg_send_chunk(demux_plugin_t *thi - buf->extra_info->input_time = pts / 90; - buf->pts = pts; - -- if (last_frame_pts) { -+ if (this->last_frame_pts) { - buf->decoder_flags |= BUF_FLAG_FRAMERATE; -- buf->decoder_info[0] = buf->pts - last_frame_pts; -+ buf->decoder_info[0] = buf->pts - this->last_frame_pts; - } - -- if ((int)remaining_sample_bytes > buf->max_size) -+ if (remaining_sample_bytes > (unsigned)buf->max_size) - buf->size = buf->max_size; - else - buf->size = remaining_sample_bytes; -@@ -294,7 +292,7 @@ static int demux_smjpeg_send_chunk(demux_plugin_t *thi - } - - if (chunk_tag == vidD_TAG) -- last_frame_pts = buf->pts; -+ this->last_frame_pts = pts; - - return this->status; - } -@@ -359,6 +357,7 @@ static int demux_smjpeg_seek (demux_plugin_t *this_gen - - this->status = DEMUX_OK; - } -+ this->last_frame_pts = 0; - - return this->status; - } Index: patches/patch-src_dxr3_ffmpeg_encoder_c =================================================================== RCS file: patches/patch-src_dxr3_ffmpeg_encoder_c diff -N patches/patch-src_dxr3_ffmpeg_encoder_c --- patches/patch-src_dxr3_ffmpeg_encoder_c 3 Apr 2022 11:12:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,26 +0,0 @@ -- ffmpeg_encoder: fix setting codec option - 81ba6f23b5362d8bb9140b210dd562f05add1bb0 -- Add const - 2750d2ee4ad1beb661bffd9cb696d6a5d619e5cf - -Index: src/dxr3/ffmpeg_encoder.c ---- src/dxr3/ffmpeg_encoder.c.orig -+++ src/dxr3/ffmpeg_encoder.c -@@ -123,7 +123,7 @@ static int lavc_prepare_frame(lavc_data_t *this, dxr3_ - static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame) - { - lavc_data_t *this = (lavc_data_t *)drv->enc; -- AVCodec *codec; -+ const AVCodec *codec; - unsigned char use_quantizer; - - if (this->context) { -@@ -223,7 +223,7 @@ static int lavc_on_update_format(dxr3_driver_t *drv, d - this->context->gop_size = 0; /*intra frames only */ - /* TJ. this version is known to have that but maybe its not the first. */ - #if LIBAVCODEC_VERSION_INT >= XFF_INT_VERSION(56,56,101) -- av_opt_set_int (codec, "motion_est", 0 /* "zero" */, 0); -+ av_opt_set_int (this->context->priv_data, "motion_est", 0 /* "zero" */, 0); - #else - this->context->me_method = ME_ZERO; /*motion estimation type*/ - #endif Index: patches/patch-src_post_Makefile_in =================================================================== RCS file: /home/cvs/ports/multimedia/xine-lib/patches/patch-src_post_Makefile_in,v retrieving revision 1.3 diff -u -p -u -p -r1.3 patch-src_post_Makefile_in --- patches/patch-src_post_Makefile_in 24 Mar 2022 16:28:53 -0000 1.3 +++ patches/patch-src_post_Makefile_in 26 Jan 2023 05:14:35 -0000 @@ -1,7 +1,7 @@ Index: src/post/Makefile.in --- src/post/Makefile.in.orig +++ src/post/Makefile.in -@@ -899,7 +899,7 @@ libdeinterlaceplugins_O1_la_SOURCES = \ +@@ -847,7 +847,7 @@ libdeinterlaceplugins_O1_la_SOURCES = \ $(debug_sources) libdeinterlaceplugins_O1_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/post/deinterlace @@ -10,7 +10,7 @@ Index: src/post/Makefile.in libdeinterlaceplugins_O1_la_LDFLAGS = libdeinterlaceplugins_la_SOURCES = \ deinterlace/plugins/double.c \ -@@ -944,7 +944,7 @@ xineplug_post_tvtime_la_LDFLAGS = $(AM_LDFLAGS) $(IMPU +@@ -892,7 +892,7 @@ xineplug_post_tvtime_la_LDFLAGS = $(AM_LDFLAGS) $(IMPU @ENABLE_POSTPROC_TRUE@pp_module_cflags = $(FFMPEG_CFLAGS) $(POSTPROC_CFLAGS) @ARCH_X86_TRUE@PLANAR_X86_LIB = libpost_planar_x86.la @ARCH_X86_TRUE@libpost_planar_x86_la_SOURCES = planar/x86/noise.c planar/x86/noise.h Index: patches/patch-src_post_visualizations_tdaudioanalyzer_c =================================================================== RCS file: patches/patch-src_post_visualizations_tdaudioanalyzer_c diff -N patches/patch-src_post_visualizations_tdaudioanalyzer_c --- patches/patch-src_post_visualizations_tdaudioanalyzer_c 25 Mar 2022 09:42:38 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -Use int64_t when calculating pts -7fd1885d7c3be202ed48609ee3f63ed1b642df9f - -Index: src/post/visualizations/tdaudioanalyzer.c ---- src/post/visualizations/tdaudioanalyzer.c.orig -+++ src/post/visualizations/tdaudioanalyzer.c -@@ -846,7 +846,7 @@ static void tdaan_port_put_buffer ( - if (pts) { - int offs = (this->ring_put - this->ring_get) & RING_MASK; - offs -= this->samples_per_frame >> 1; -- pts -= 90000 * offs / (int)port->rate; -+ pts -= INT64_C(90000) * offs / (int)port->rate; - } - /* buffer incoming audio */ - do { Index: patches/patch-src_xine-utils_utils_c =================================================================== RCS file: /home/cvs/ports/multimedia/xine-lib/patches/patch-src_xine-utils_utils_c,v retrieving revision 1.10 diff -u -p -u -p -r1.10 patch-src_xine-utils_utils_c --- patches/patch-src_xine-utils_utils_c 25 Mar 2022 09:42:38 -0000 1.10 +++ patches/patch-src_xine-utils_utils_c 22 Dec 2022 23:00:31 -0000 @@ -1,8 +1,5 @@ -- Make use of clock_gettime() on OpenBSD. Until we have per-process - timers and can enable _POSIX_TIMERS in unistd.h. - -- Fix fd lead (error path) - ef445262b10938eb7c0373d42fef0f465a3fb479 +Make use of clock_gettime() on OpenBSD. Until we have per-process +timers and can enable _POSIX_TIMERS in unistd.h. Index: src/xine-utils/utils.c --- src/xine-utils/utils.c.orig @@ -17,21 +14,3 @@ Index: src/xine-utils/utils.c static int xmc_mode = 0; do { -@@ -1299,11 +1300,15 @@ xine_fast_text_t *xine_fast_text_load (const char *fil - f = fopen (filename, "rb"); - if (!f) - return NULL; -- if (fseek (f, 0, SEEK_END)) -+ if (fseek (f, 0, SEEK_END)) { -+ fclose(f); - return NULL; -+ } - filesize = ftell (f); -- if (fseek (f, 0, SEEK_SET)) -+ if (fseek (f, 0, SEEK_SET)) { -+ fclose(f); - return NULL; -+ } - - if (filesize > max_size) - filesize = max_size;