update to xine-lib 1.1.20, from Brad

This commit is contained in:
sthen 2011-11-16 00:43:17 +00:00
parent 52c177c5ac
commit be48a0a8ae
33 changed files with 41 additions and 1796 deletions

View File

@ -1,16 +1,15 @@
# $OpenBSD: Makefile,v 1.83 2011/10/30 21:20:19 dcoppa Exp $
# $OpenBSD: Makefile,v 1.84 2011/11/16 00:43:17 sthen Exp $
SHARED_ONLY= Yes
COMMENT= multimedia decoding library
DISTNAME= xine-lib-1.1.19
REVISION= 13
DISTNAME= xine-lib-1.1.20
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=xine/}
EXTRACT_SUFX= .tar.bz2
EXTRACT_SUFX= .tar.xz
SHARED_LIBS= xine 28.0
SHARED_LIBS= xine 29.0
HOMEPAGE= http://www.xine-project.org/
@ -21,15 +20,16 @@ PERMIT_PACKAGE_CDROM= patents
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= FLAC GL GLU SDL X11 Xau Xdamage Xdmcp Xext Xfixes Xinerama \
Xv XvMCW Xxf86vm a52 avcodec avutil c cdio dca drm dvdnav \
dvdread expat faad fontconfig freetype gsm iso9660 jpeg \
lcms m mad modplug mpcdec mng mp3lame ogg orc-0.4 postproc \
pthread-stubs pthread schroedinger-1.0 sndio speex theora \
theoradec theoraenc usbhid vcdinfo vorbis vorbisenc vpx \
wavpack x264 xcb-shape xcb-shm xcb-xv xcb z
pthread-stubs pthread schroedinger-1.0 sndio speex stdc++ \
theora theoradec theoraenc usbhid vcdinfo vorbis vorbisenc \
vpx wavpack x264 xcb-shape xcb-shm xcb-xv xcb z
XINEAPI_REV= 1.29
XINEAPI_REV= 1.30
SUBST_VARS+= XINEAPI_REV
MODULES= devel/gettext
@ -62,7 +62,7 @@ USE_GMAKE= Yes
USE_LIBTOOL= Yes
USE_GROFF = Yes
CONFIGURE_STYLE= autoconf
AUTOCONF_VERSION= 2.65
AUTOCONF_VERSION= 2.68
CONFIGURE_ARGS+=--disable-aalib \
--disable-dxr3 \
--disable-fb \

View File

@ -1,5 +1,5 @@
MD5 (xine-lib-1.1.19.tar.bz2) = pBCg8GF+HWMJ8MvpB/c/ig==
RMD160 (xine-lib-1.1.19.tar.bz2) = hJmcQ9PMEVw72ksuBgidyCfGRsw=
SHA1 (xine-lib-1.1.19.tar.bz2) = WvzCjFzyvaq5nZUZYPZYd5fh5aA=
SHA256 (xine-lib-1.1.19.tar.bz2) = YnfGxTQ61FAnSS0LNDfxiUs9NP2bKSY42iv0rnSdh3Q=
SIZE (xine-lib-1.1.19.tar.bz2) = 7531642
MD5 (xine-lib-1.1.20.tar.xz) = rPtuCBiP1grYj/g4MdWS1w==
RMD160 (xine-lib-1.1.20.tar.xz) = A5p9DuTmXOIHVdSrv7+a9uF6N8U=
SHA1 (xine-lib-1.1.20.tar.xz) = Hb1I4UETc5EBQpOR1F9l679lGfw=
SHA256 (xine-lib-1.1.20.tar.xz) = 2mXaWDH1uT8CtOwQBJ6vBEz5mUTi/Y4S1JTczv7hJOs=
SIZE (xine-lib-1.1.20.tar.xz) = 5957256

View File

@ -1,15 +1,6 @@
$OpenBSD: patch-configure_ac,v 1.8 2011/10/09 20:45:07 sthen Exp $
$OpenBSD: patch-configure_ac,v 1.9 2011/11/16 00:43:17 sthen Exp $
--- configure.ac.orig Sun Jul 25 10:37:30 2010
+++ configure.ac Wed Sep 28 03:18:47 2011
@@ -412,7 +412,7 @@ for ucname in $ffmpeg_uncommon_codecs; do
done
dnl popular ffmpeg codecs
-ffmpeg_popular_codecs="CINEPAK FLASHSV H261 H263 H263I H264 INDEO2 INDEO3 MJPEG MJPEGB MPEG1VIDEO MPEG2VIDEO MPEG4 MPEGVIDEO MSMPEG4V1 MSMPEG4V2 MSMPEG4V3 MSRLE MSVIDEO1 QTRLE RV10 RV20 SVQ1 SVQ3 VC1 VP3 VP5 VP6 VP6F WMV1 WMV2 WMV3 COOK DTS EAC3 FLAC MP2 MP3 QDM2 RA_144 RA_288 WAVPACK WMAV1 WMAV2 WMAPRO ADPCM_SWF"
+ffmpeg_popular_codecs="CINEPAK FLASHSV H261 H263 H263I H264 INDEO2 INDEO3 MJPEG MJPEGB MPEG1VIDEO MPEG2VIDEO MPEG4 MPEGVIDEO MSMPEG4V1 MSMPEG4V2 MSMPEG4V3 MSRLE MSVIDEO1 QTRLE RV10 RV20 RV30 RV40 SVQ1 SVQ3 VC1 VP3 VP5 VP6 VP6F VP8 WMV1 WMV2 WMV3 COOK DTS EAC3 FLAC MP2 MP3 QDM2 RA_144 RA_288 WAVPACK WMAV1 WMAV2 WMAPRO ADPCM_SWF"
for ucname in $ffmpeg_popular_codecs; do
config_name="CONFIG_${ucname}_DECODER"
@@ -565,9 +565,9 @@ t q
b
:q
@ -44,12 +35,3 @@ $OpenBSD: patch-configure_ac,v 1.8 2011/10/09 20:45:07 sthen Exp $
AC_SUBST(MNG_LIBS)
else
have_libmng=no
@@ -2708,6 +2709,8 @@ CC_CHECK_CFLAGS_APPEND([-Wformat=2 -Wformat],
[CC_CHECK_CFLAGS_APPEND([-Wno-format-zero-length])
break;
])
+
+CC_CHECK_CFLAGS_APPEND([-Wformat-security])
dnl check for strict aliasing problem, get the highest between =2 and
dnl normal.

View File

@ -1,38 +0,0 @@
$OpenBSD: patch-m4_dvdnav_m4,v 1.2 2010/09/13 20:12:16 sthen Exp $
--- m4/dvdnav.m4.orig Wed Mar 10 15:46:05 2010
+++ m4/dvdnav.m4 Sun Jul 25 15:33:46 2010
@@ -84,6 +84,7 @@ dnl checks the results of dvdnav-config to some extent
dnl
rm -f conf.dvdnavtest
AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <stdint.h>
#include <dvdnav/dvdnav.h>
#include <stdio.h>
#include <stdlib.h>
@@ -129,6 +130,7 @@ main ()
]])],[],[no_dvdnav=yes],[no_dvdnav=cc])
if test "x$no_dvdnav" = xcc; then
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdint.h>
#include <dvdnav/dvdnav.h>
#include <stdio.h>
]], [[ return 0; ]])],[no_dvdnav=''],[no_dvdnav=yes])
@@ -141,7 +143,9 @@ main ()
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
dnl nav_*.h seem to have been moved from dvdnav at some point?
- AC_CHECK_HEADERS([dvdread/nav_types.h])
+ AC_CHECK_HEADERS([dvdread/nav_types.h],,,
+[#include <stdint.h>
+])
else
AC_MSG_RESULT(no)
if test "$DVDNAV_CONFIG" = "no" ; then
@@ -157,6 +161,7 @@ main ()
CFLAGS="$CFLAGS $DVDNAV_CFLAGS"
LIBS="$LIBS $DVDNAV_LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdint.h>
#include <dvdnav/dvdnav.h>
#include <stdio.h>
]], [[ return 0; ]])],

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-src_audio_out_audio_file_out_c,v 1.1 2011/11/16 00:43:17 sthen Exp $
--- src/audio_out/audio_file_out.c.orig Sat Nov 12 22:09:55 2011
+++ src/audio_out/audio_file_out.c Sat Nov 12 22:17:03 2011
@@ -30,6 +30,7 @@
#include <math.h>
#include <unistd.h>
#include <inttypes.h>
+#include <sys/stat.h>
#include "xine_internal.h"
#include "xineutils.h"

View File

@ -1,187 +0,0 @@
$OpenBSD: patch-src_combined_ffmpeg_ff_audio_decoder_c,v 1.2 2011/10/09 20:45:07 sthen Exp $
- Eliminate use of old FFmpeg APIs.
- Fix audio crash (SSE2 alignment).
- Use xine's fast memcpy.
- Pad end of audio data buffer with zeros.
- Not every audio packet can be used to determine the sample rate and number of
audio channels.
--- src/combined/ffmpeg/ff_audio_decoder.c.orig Tue Mar 23 11:41:49 2010
+++ src/combined/ffmpeg/ff_audio_decoder.c Sun Oct 2 15:45:17 2011
@@ -46,6 +46,12 @@
#define AUDIOBUFSIZE (64 * 1024)
+#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32)
+# define AVAUDIO 3
+#else
+# define AVAUDIO 2
+#endif
+
typedef struct {
audio_decoder_class_t decoder_class;
} ff_audio_class_t;
@@ -75,13 +81,41 @@ typedef struct ff_audio_decoder_s {
#include "ff_audio_list.h"
+#define malloc16(s) realloc16(NULL,s)
+#define free16(p) realloc16(p,0)
+
+static void *realloc16 (void *m, size_t s) {
+ unsigned long diff, diff2;
+ unsigned char *p = m, *q;
+ if (p) {
+ diff = p[-1];
+ if (s == 0) {
+ free (p - diff);
+ return (NULL);
+ }
+ q = realloc (p - diff, s + 16);
+ if (!q) return (q);
+ diff2 = 16 - ((unsigned long)q & 15);
+ if (diff2 != diff) memmove (q + diff2, q + diff, s);
+ } else {
+ if (s == 0) return (NULL);
+ q = malloc (s + 16);
+ if (!q) return (q);
+ diff2 = 16 - ((unsigned long)q & 15);
+ }
+ q += diff2;
+ q[-1] = diff2;
+ return (q);
+}
+
+
static void ff_audio_ensure_buffer_size(ff_audio_decoder_t *this, int size) {
if (size > this->bufsize) {
this->bufsize = size + size / 2;
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
_("ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"),
this->bufsize);
- this->buf = realloc( this->buf, this->bufsize );
+ this->buf = realloc16 (this->buf, this->bufsize + FF_INPUT_BUFFER_PADDING_SIZE);
}
}
@@ -94,14 +128,13 @@ static void ff_audio_decode_data (audio_decoder_t *thi
int out;
audio_buffer_t *audio_buffer;
int bytes_to_send;
- unsigned int codec_type = buf->type & 0xFFFF0000;
+ unsigned int codec_type = buf->type & (BUF_MAJOR_MASK | BUF_DECODER_MASK);
- if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
- !(buf->decoder_flags & BUF_FLAG_SPECIAL) ) {
+ if ( (buf->decoder_flags & (BUF_FLAG_HEADER | BUF_FLAG_SPECIAL)) == BUF_FLAG_HEADER ) {
/* accumulate init data */
ff_audio_ensure_buffer_size(this, this->size + buf->size);
- memcpy(this->buf + this->size, buf->content, buf->size);
+ xine_fast_memcpy(this->buf + this->size, buf->content, buf->size);
this->size += buf->size;
if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
@@ -241,7 +274,7 @@ static void ff_audio_decode_data (audio_decoder_t *thi
this->size = 0;
- this->decode_buffer = calloc(1, AVCODEC_MAX_AUDIO_FRAME_SIZE);
+ this->decode_buffer = malloc16 (AVCODEC_MAX_AUDIO_FRAME_SIZE);
return;
}
@@ -255,6 +288,9 @@ static void ff_audio_decode_data (audio_decoder_t *thi
buf->decoder_info[2]);
} else if (!(buf->decoder_flags & BUF_FLAG_SPECIAL)) {
+#if AVAUDIO > 2
+ AVPacket avpkt;
+#endif
if( !this->decoder_ok ) {
if ( ! this->context || ! this->codec ) {
@@ -285,17 +321,36 @@ static void ff_audio_decode_data (audio_decoder_t *thi
if (!this->output_open) {
if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) {
+ int ret;
+
decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
- avcodec_decode_audio2 (this->context,
- (int16_t *)this->decode_buffer,
- &decode_buffer_size,
- &this->buf[0],
- this->size);
+#if AVAUDIO > 2
+ av_init_packet (&avpkt);
+ avpkt.data = (uint8_t *)&this->buf[0];
+ avpkt.size = this->size;
+ avpkt.flags = AV_PKT_FLAG_KEY;
+ ret = avcodec_decode_audio3 (this->context,
+ (int16_t *)this->decode_buffer,
+ &decode_buffer_size, &avpkt);
+#else
+ ret = avcodec_decode_audio2 (this->context,
+ (int16_t *)this->decode_buffer,
+ &decode_buffer_size,
+ &this->buf[0],
+ this->size);
+#endif
this->audio_bits = this->context->bits_per_sample;
this->audio_sample_rate = this->context->sample_rate;
this->audio_channels = this->context->channels;
- if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels)
+ if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("ffmpeg_audio_dec: cannot read codec parameters from packet (error=%d)\n"), ret);
+
+ /* We can't use this packet, so we must discard it
+ * and wait for another one. */
+ this->size = 0;
return;
+ }
}
this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
this->stream, this->audio_bits, this->audio_sample_rate,
@@ -309,14 +364,27 @@ static void ff_audio_decode_data (audio_decoder_t *thi
if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */
offset = 0;
+
+ /* pad input data */
+ memset(&this->buf[this->size], 0, FF_INPUT_BUFFER_PADDING_SIZE);
+
while (this->size>0) {
decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+#if AVAUDIO > 2
+ av_init_packet (&avpkt);
+ avpkt.data = (uint8_t *)&this->buf[offset];
+ avpkt.size = this->size;
+ avpkt.flags = AV_PKT_FLAG_KEY;
+ bytes_consumed = avcodec_decode_audio3 (this->context,
+ (int16_t *)this->decode_buffer,
+ &decode_buffer_size, &avpkt);
+#else
bytes_consumed = avcodec_decode_audio2 (this->context,
(int16_t *)this->decode_buffer,
&decode_buffer_size,
&this->buf[offset],
this->size);
-
+#endif
if (bytes_consumed<0) {
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
"ffmpeg_audio_dec: error decompressing audio frame\n");
@@ -427,8 +495,8 @@ static void ff_audio_dispose (audio_decoder_t *this_ge
this->stream->audio_out->close (this->stream->audio_out, this->stream);
this->output_open = 0;
- free(this->buf);
- free(this->decode_buffer);
+ free16 (this->buf);
+ free16 (this->decode_buffer);
if(this->context && this->context->extradata)
free(this->context->extradata);

View File

@ -1,400 +0,0 @@
$OpenBSD: patch-src_combined_ffmpeg_ff_video_decoder_c,v 1.6 2011/10/09 20:45:07 sthen Exp $
- Eliminate use of old FFmpeg APIs.
- RV30 & RV40 support.
- Fixed multithreaded decoding with lavc >= 52.112.0.
- VC-1: scan for extradata (sequence header) from preview buffers.
- Do not require preview buffers for MPEG1/2.
--- src/combined/ffmpeg/ff_video_decoder.c.orig Wed Mar 10 14:07:15 2010
+++ src/combined/ffmpeg/ff_video_decoder.c Sun Oct 2 15:47:43 2011
@@ -58,6 +58,18 @@
#define ENABLE_DIRECT_RENDERING
+#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32)
+# define AVVIDEO 2
+#else
+# define AVVIDEO 1
+# define pp_context pp_context_t
+# define pp_mode pp_mode_t
+#endif
+
+#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 112)
+# define DEPRECATED_AVCODEC_THREAD_INIT 1
+#endif
+
/* reordered_opaque appeared in libavcodec 51.68.0 */
#define AVCODEC_HAS_REORDERED_OPAQUE
#if LIBAVCODEC_VERSION_INT < 0x334400
@@ -116,8 +128,8 @@ struct ff_video_decoder_s {
int pp_quality;
int pp_flags;
- pp_context_t *pp_context;
- pp_mode_t *pp_mode;
+ pp_context *our_context;
+ pp_mode *our_mode;
/* mpeg-es parsing */
mpeg_parser_t *mpeg_parser;
@@ -321,6 +333,10 @@ static void init_video_codec (ff_video_decoder_t *this
this->context->flags |= CODEC_FLAG_EMU_EDGE;
}
+ /* TJ. without this, it wont work at all on my machine */
+ this->context->codec_id = this->codec->id;
+ this->context->codec_type = this->codec->type;
+
if (this->class->choose_speed_over_accuracy)
this->context->flags2 |= CODEC_FLAG2_FAST;
@@ -353,7 +369,10 @@ static void init_video_codec (ff_video_decoder_t *this
if (this->class->thread_count > 1) {
if (this->codec->id != CODEC_ID_SVQ3
- && avcodec_thread_init(this->context, this->class->thread_count) != -1)
+#ifndef DEPRECATED_AVCODEC_THREAD_INIT
+ && avcodec_thread_init(this->context, this->class->thread_count) != -1
+#endif
+ )
this->context->thread_count = this->class->thread_count;
}
@@ -444,23 +463,23 @@ static void pp_change_quality (ff_video_decoder_t *thi
this->pp_quality = this->class->pp_quality;
if(this->pp_available && this->pp_quality) {
- if(!this->pp_context && this->context)
- this->pp_context = pp_get_context(this->context->width, this->context->height,
+ if(!this->our_context && this->context)
+ this->our_context = pp_get_context(this->context->width, this->context->height,
this->pp_flags);
- if(this->pp_mode)
- pp_free_mode(this->pp_mode);
+ if(this->our_mode)
+ pp_free_mode(this->our_mode);
- this->pp_mode = pp_get_mode_by_name_and_quality("hb:a,vb:a,dr:a",
+ this->our_mode = pp_get_mode_by_name_and_quality("hb:a,vb:a,dr:a",
this->pp_quality);
} else {
- if(this->pp_mode) {
- pp_free_mode(this->pp_mode);
- this->pp_mode = NULL;
+ if(this->our_mode) {
+ pp_free_mode(this->our_mode);
+ this->our_mode = NULL;
}
- if(this->pp_context) {
- pp_free_context(this->pp_context);
- this->pp_context = NULL;
+ if(this->our_context) {
+ pp_free_context(this->our_context);
+ this->our_context = NULL;
}
}
}
@@ -502,17 +521,6 @@ static void init_postprocess (ff_video_decoder_t *this
static int ff_handle_mpeg_sequence(ff_video_decoder_t *this, mpeg_parser_t *parser) {
- /*
- * init codec
- */
- if (this->decoder_init_mode) {
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC,
- "mpeg-1 (ffmpeg)");
-
- init_video_codec (this, BUF_VIDEO_MPEG);
- this->decoder_init_mode = 0;
- }
-
/* frame format change */
if ((parser->width != this->bih.biWidth) ||
(parser->height != this->bih.biHeight) ||
@@ -843,6 +851,67 @@ static void ff_check_bufsize (ff_video_decoder_t *this
}
}
+static int ff_vc1_find_header(ff_video_decoder_t *this, buf_element_t *buf)
+{
+ uint8_t *p = buf->content;
+
+ if (!p[0] && !p[1] && p[2] == 1 && p[3] == 0x0f) {
+ int i;
+
+ this->context->extradata = calloc(1, buf->size);
+ this->context->extradata_size = 0;
+
+ for (i = 0; i < buf->size && i < 128; i++) {
+ if (!p[i] && !p[i+1] && p[i+2]) {
+ lprintf("00 00 01 %02x at %d\n", p[i+3], i);
+ if (p[i+3] != 0x0e && p[i+3] != 0x0f)
+ break;
+ }
+ this->context->extradata[i] = p[i];
+ this->context->extradata_size++;
+ }
+
+ lprintf("ff_video_decoder: found VC1 sequence header\n");
+ return 1;
+ }
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "ffmpeg_video_dec: VC1 extradata missing !\n");
+ return 0;
+}
+
+static int ff_check_extradata(ff_video_decoder_t *this, unsigned int codec_type, buf_element_t *buf)
+{
+ if (this->context && this->context->extradata)
+ return 1;
+
+ switch (codec_type) {
+ case BUF_VIDEO_VC1:
+ return ff_vc1_find_header(this, buf);
+ default:;
+ }
+
+ return 1;
+}
+
+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)");
+
+ init_video_codec (this, BUF_VIDEO_MPEG);
+ this->decoder_init_mode = 0;
+ }
+
+ if ( this->mpeg_parser == NULL ) {
+ this->mpeg_parser = calloc(1, sizeof(mpeg_parser_t));
+ mpeg_parser_init(this->mpeg_parser);
+ }
+}
+
static void ff_handle_preview_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
int codec_type;
@@ -850,15 +919,14 @@ static void ff_handle_preview_buffer (ff_video_decoder
codec_type = buf->type & 0xFFFF0000;
if (codec_type == BUF_VIDEO_MPEG) {
- this->is_mpeg12 = 1;
- if ( this->mpeg_parser == NULL ) {
- this->mpeg_parser = calloc(1, sizeof(mpeg_parser_t));
- mpeg_parser_init(this->mpeg_parser);
- this->decoder_init_mode = 0;
- }
+ ff_init_mpeg12_mode(this);
}
if (this->decoder_init_mode && !this->is_mpeg12) {
+
+ if (!ff_check_extradata(this, codec_type, buf))
+ return;
+
init_video_codec(this, codec_type);
init_postprocess(this);
this->decoder_init_mode = 0;
@@ -902,6 +970,8 @@ static void ff_handle_header_buffer (ff_video_decoder_
switch (codec_type) {
case BUF_VIDEO_RV10:
case BUF_VIDEO_RV20:
+ case BUF_VIDEO_RV30:
+ case BUF_VIDEO_RV40:
this->bih.biWidth = _X_BE_16(&this->buf[12]);
this->bih.biHeight = _X_BE_16(&this->buf[14]);
@@ -1022,6 +1092,11 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_
lprintf("handle_mpeg12_buffer\n");
+ if (!this->is_mpeg12) {
+ /* initialize mpeg parser */
+ ff_init_mpeg12_mode(this);
+ }
+
while ((size > 0) || (flush == 1)) {
uint8_t *current;
@@ -1055,12 +1130,26 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_
}
/* skip decoding b frames if too late */
+#if AVVIDEO > 1
+ this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
+#else
this->context->hurry_up = (this->skipframes > 0);
+#endif
lprintf("avcodec_decode_video: size=%d\n", this->mpeg_parser->buffer_size);
+#if AVVIDEO > 1
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = (uint8_t *)this->mpeg_parser->chunk_buffer;
+ avpkt.size = this->mpeg_parser->buffer_size;
+ avpkt.flags = AV_PKT_FLAG_KEY;
+ len = avcodec_decode_video2 (this->context, this->av_frame,
+ &got_picture, &avpkt);
+#else
len = avcodec_decode_video (this->context, this->av_frame,
&got_picture, this->mpeg_parser->chunk_buffer,
this->mpeg_parser->buffer_size);
+#endif
lprintf("avcodec_decode_video: decoded_size=%d, got_picture=%d\n",
len, got_picture);
len = current - buf->content - offset;
@@ -1112,7 +1201,13 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_
} else {
- if (this->context->hurry_up) {
+ if (
+#if AVVIDEO > 1
+ this->context->skip_frame != AVDISCARD_DEFAULT
+#else
+ this->context->hurry_up
+#endif
+ ) {
/* skipped frame, output a bad frame */
img = this->stream->video_out->get_frame (this->stream->video_out,
this->bih.biWidth,
@@ -1178,49 +1273,6 @@ static void ff_check_pts_tagging(ff_video_decoder_t *t
}
#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
-static int ff_vc1_find_header(ff_video_decoder_t *this, buf_element_t *buf)
-{
- uint8_t *p = buf->content;
-
- if (!p[0] && !p[1] && p[2] == 1 && p[3] == 0x0f) {
- int i;
-
- this->context->extradata = calloc(1, buf->size);
- this->context->extradata_size = 0;
-
- for (i = 0; i < buf->size && i < 128; i++) {
- if (!p[i] && !p[i+1] && p[i+2]) {
- lprintf("00 00 01 %02x at %d\n", p[i+3], i);
- if (p[i+3] != 0x0e && p[i+3] != 0x0f)
- break;
- }
- this->context->extradata[i] = p[i];
- this->context->extradata_size++;
- }
-
- lprintf("ff_video_decoder: found VC1 sequence header\n");
- return 1;
- }
-
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "ffmpeg_video_dec: VC1 extradata missing !\n");
- return 0;
-}
-
-static int ff_check_extradata(ff_video_decoder_t *this, unsigned int codec_type, buf_element_t *buf)
-{
- if (this->context && this->context->extradata)
- return 1;
-
- switch (codec_type) {
- case BUF_VIDEO_VC1:
- return ff_vc1_find_header(this, buf);
- default:;
- }
-
- return 1;
-}
-
static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
uint8_t *chunk_buf = this->buf;
AVRational avr00 = {0, 1};
@@ -1229,7 +1281,7 @@ static void ff_handle_buffer (ff_video_decoder_t *this
if (!this->decoder_ok) {
if (this->decoder_init_mode) {
- int codec_type = buf->type & 0xFFFF0000;
+ int codec_type = buf->type & (BUF_MAJOR_MASK | BUF_DECODER_MASK);
if (!ff_check_extradata(this, codec_type, buf))
return;
@@ -1304,13 +1356,25 @@ static void ff_handle_buffer (ff_video_decoder_t *this
got_picture = 0;
} else {
/* skip decoding b frames if too late */
+#if AVVIDEO > 1
+ this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
+#else
this->context->hurry_up = (this->skipframes > 0);
-
+#endif
lprintf("buffer size: %d\n", this->size);
+#if AVVIDEO > 1
+ AVPacket avpkt;
+ av_init_packet(&avpkt);
+ avpkt.data = (uint8_t *)&chunk_buf[offset];
+ avpkt.size = this->size;
+ avpkt.flags = AV_PKT_FLAG_KEY;
+ len = avcodec_decode_video2 (this->context, this->av_frame,
+ &got_picture, &avpkt);
+#else
len = avcodec_decode_video (this->context, this->av_frame,
&got_picture, &chunk_buf[offset],
this->size);
-
+#endif
#ifdef AVCODEC_HAS_REORDERED_OPAQUE
/* reset consumed pts value */
this->context->reordered_opaque = ff_tag_pts(this, 0);
@@ -1432,7 +1496,7 @@ static void ff_handle_buffer (ff_video_decoder_t *this
img->base, img->pitches,
img->width, img->height,
this->av_frame->qscale_table, this->av_frame->qstride,
- this->pp_mode, this->pp_context,
+ this->our_mode, this->our_context,
this->av_frame->pict_type);
} else if (!this->av_frame->opaque) {
@@ -1555,7 +1619,7 @@ static void ff_decode_data (video_decoder_t *this_gen,
if (buf->pts)
this->pts = buf->pts;
- if (this->is_mpeg12) {
+ if ((buf->type & 0xFFFF0000) == BUF_VIDEO_MPEG) {
ff_handle_mpeg12_buffer(this, buf);
} else {
ff_handle_buffer(this, buf);
@@ -1676,11 +1740,11 @@ static void ff_dispose (video_decoder_t *this_gen) {
free(this->buf);
this->buf = NULL;
- if(this->pp_context)
- pp_free_context(this->pp_context);
+ if(this->our_context)
+ pp_free_context(this->our_context);
- if(this->pp_mode)
- pp_free_mode(this->pp_mode);
+ if(this->our_mode)
+ pp_free_mode(this->our_mode);
mpeg_parser_dispose(this->mpeg_parser);
@@ -1721,8 +1785,8 @@ static video_decoder_t *ff_video_open_plugin (video_de
this->aspect_ratio = 0;
this->pp_quality = 0;
- this->pp_context = NULL;
- this->pp_mode = NULL;
+ this->our_context = NULL;
+ this->our_mode = NULL;
this->mpeg_parser = NULL;

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-src_combined_ffmpeg_xine_video_list,v 1.1 2011/10/09 20:45:07 sthen Exp $
--- src/combined/ffmpeg/xine_video.list.orig Wed Sep 28 01:30:30 2011
+++ src/combined/ffmpeg/xine_video.list Wed Sep 28 01:36:42 2011
@@ -24,6 +24,8 @@ I263 H263I ITU H.263
H263 H263 H.263
RV10 RV10 Real Video 1.0
RV20 RV20 Real Video 2.0
+RV30 RV30 Real Video 3.0
+RV40 RV40 Real Video 4.0
IV31 INDEO3 Indeo Video 3.1
IV32 INDEO3 Indeo Video 3.2
SORENSON_V1 SVQ1 Sorenson Video 1
@@ -34,6 +36,7 @@ VP31 VP3 On2 VP3.1
VP5 VP5 On2 VP5
VP6 VP6 On2 VP6
VP6F VP6F On2 VP6
+VP8 VP8 On2 VP8
4XM 4XM 4X Video
CINEPAK CINEPAK Cinepak
MSVC MSVIDEO1 Microsoft Video 1

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-src_demuxers_demux_aac_c,v 1.1 2011/05/11 09:05:54 dcoppa Exp $
Check that we've found both AAC signatures.
--- src/demuxers/demux_aac.c.orig Mon May 9 21:12:42 2011
+++ src/demuxers/demux_aac.c Mon May 9 21:13:13 2011
@@ -122,6 +122,10 @@ static int open_aac_file(demux_aac_t *this) {
syncword = (syncword << 8) | peak[i];
}
+ /* did we really find the ADTS header? */
+ if (i == MAX_PREVIEW_SIZE)
+ return 0; /* No, we didn't */
+
/* Look for second ADTS header to confirm it's really aac */
if (data_start + 5 < MAX_PREVIEW_SIZE) {
int frame_size = ((peak[data_start+3] & 0x03) << 11) |

View File

@ -1,154 +0,0 @@
$OpenBSD: patch-src_demuxers_demux_matroska_c,v 1.7 2011/10/30 21:20:21 dcoppa Exp $
- Header stripping support.
- VP8 support.
- Fix NULL dereferences and skipping of unknown elements.
--- src/demuxers/demux_matroska.c.orig Mon Jul 19 14:01:43 2010
+++ src/demuxers/demux_matroska.c Fri Oct 28 00:49:57 2011
@@ -304,8 +304,12 @@ static int parse_content_compression (demux_matroska_t
}
break;
case MATROSKA_ID_CE_COMPSETTINGS:
- lprintf("ContentCompSettings (UNSUPPORTED)\n");
- if (!ebml_skip(ebml, &elem))
+ lprintf("ContentCompSettings\n");
+ track->compress_settings = calloc(1, elem.len);
+ track->compress_len = elem.len;
+ if (elem.len > this->compress_maxlen)
+ this->compress_maxlen = elem.len;
+ if(!ebml_read_binary(ebml, &elem, track->compress_settings))
return 0;
break;
default:
@@ -1327,6 +1331,29 @@ static int parse_track_entry(demux_matroska_t *this, m
lprintf("MATROSKA_CODEC_ID_V_MPEG2\n");
track->buf_type = BUF_VIDEO_MPEG;
init_codec = init_codec_video;
+ } else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_VP8)) {
+ xine_bmiheader *bih;
+
+ lprintf("MATROSKA_CODEC_ID_V_VP8\n");
+ if (track->codec_private_len > 0x7fffffff - sizeof(xine_bmiheader))
+ track->codec_private_len = 0x7fffffff - sizeof(xine_bmiheader);
+
+ /* create a bitmap info header struct for vp8 */
+ bih = calloc(1, sizeof(xine_bmiheader) + track->codec_private_len);
+ bih->biSize = sizeof(xine_bmiheader) + track->codec_private_len;
+ bih->biCompression = ME_FOURCC('v', 'p', '8', '0');
+ bih->biWidth = track->video_track->pixel_width;
+ bih->biHeight = track->video_track->pixel_height;
+ _x_bmiheader_le2me(bih);
+
+ /* add bih extra data */
+ memcpy(bih + 1, track->codec_private, track->codec_private_len);
+ free(track->codec_private);
+ track->codec_private = (uint8_t *)bih;
+ track->codec_private_len = bih->biSize;
+ track->buf_type = BUF_VIDEO_VP8;
+
+ init_codec = init_codec_video;
} else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_REAL_RV10)) {
} else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_REAL_RV20)) {
} else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_REAL_RV30)) {
@@ -1784,8 +1811,8 @@ static int find_track_by_id(demux_matroska_t *this, in
}
-static int read_block_data (demux_matroska_t *this, size_t len) {
- alloc_block_data(this, len);
+static int read_block_data (demux_matroska_t *this, size_t len, size_t offset) {
+ alloc_block_data(this, len + offset);
/* block datas */
if (! this->block_data) {
@@ -1793,7 +1820,7 @@ static int read_block_data (demux_matroska_t *this, si
"demux_matroska: memory allocation error\n");
return 0;
}
- if (this->input->read(this->input, this->block_data, len) != len) {
+ if (this->input->read(this->input, this->block_data + offset, len) != len) {
off_t pos = this->input->get_current_pos(this->input);
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
"demux_matroska: read error at position %" PRIdMAX "\n",
@@ -1823,8 +1850,9 @@ static int parse_block (demux_matroska_t *this, size_t
int16_t timecode_diff;
int64_t pts, xduration;
int decoder_flags = 0;
+ size_t headers_len = 0;
- data = this->block_data;
+ data = this->block_data + this->compress_maxlen;
if (!(num_len = parse_ebml_uint(this, data, &track_num)))
return 0;
data += num_len;
@@ -1877,13 +1905,22 @@ static int parse_block (demux_matroska_t *this, size_t
decoder_flags |= BUF_FLAG_PREVIEW;
}
+ if (track->compress_algo == MATROSKA_COMPRESS_HEADER_STRIP)
+ headers_len = track->compress_len;
+
if (lacing == MATROSKA_NO_LACING) {
size_t block_size_left;
lprintf("no lacing\n");
- block_size_left = (this->block_data + block_size) - data;
- lprintf("size: %d, block_size: %u\n", block_size_left, block_size);
+ block_size_left = (this->block_data + block_size + this->compress_maxlen) - data;
+ lprintf("size: %d, block_size: %u, block_offset: %u\n", block_size_left, block_size, this->compress_maxlen);
+ if (headers_len) {
+ data -= headers_len;
+ xine_fast_memcpy(data, track->compress_settings, headers_len);
+ block_size_left += headers_len;
+ }
+
if (track->handle_content != NULL) {
track->handle_content((demux_plugin_t *)this, track,
decoder_flags,
@@ -1912,7 +1949,7 @@ static int parse_block (demux_matroska_t *this, size_t
"demux_matroska: too many frames: %d\n", lace_num);
return 0;
}
- block_size_left = this->block_data + block_size - data;
+ block_size_left = this->block_data + block_size + this->compress_maxlen - data;
switch (lacing) {
case MATROSKA_XIPH_LACING: {
@@ -2045,7 +2082,7 @@ static int parse_simpleblock(demux_matroska_t *this, s
if( file_len )
normpos = (int) ( (double) block_pos * 65535 / file_len );
- if (!read_block_data(this, block_len))
+ if (!read_block_data(this, block_len, this->compress_maxlen))
return 0;
has_block = 1;
@@ -2084,7 +2121,7 @@ static int parse_block_group(demux_matroska_t *this,
if( file_len )
normpos = (int) ( (double) block_pos * 65535 / file_len );
- if (!read_block_data(this, elem.len))
+ if (!read_block_data(this, elem.len, this->compress_maxlen))
return 0;
has_block = 1;
@@ -2993,7 +3030,7 @@ static demux_plugin_t *open_plugin (demux_class_t *cla
if (ebml->max_size_len > 8)
goto error;
/* handle both Matroska and WebM here; we don't (presently) differentiate */
- if (strcmp(ebml->doctype, "matroska") && strcmp(ebml->doctype, "webm"))
+ if (!ebml->doctype || (strcmp(ebml->doctype, "matroska") && strcmp(ebml->doctype, "webm")))
goto error;
this->event_queue = xine_event_new_queue(this->stream);
@@ -3003,7 +3040,7 @@ static demux_plugin_t *open_plugin (demux_class_t *cla
error:
dispose_ebml_parser(ebml);
- if (NULL != this) {
+ if (this != NULL && this->event_queue != NULL) {
xine_event_dispose_queue(this->event_queue);
free(this);
}

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-src_demuxers_demux_matroska_h,v 1.1 2011/10/13 07:27:00 dcoppa Exp $
--- src/demuxers/demux_matroska.h.orig Tue Oct 11 02:58:00 2011
+++ src/demuxers/demux_matroska.h Tue Oct 11 02:58:28 2011
@@ -96,6 +96,7 @@ typedef struct {
int num_sub_tracks;
matroska_track_t *tracks[MAX_STREAMS];
+ size_t compress_maxlen;
/* maintain editions, number and capacity */
int num_editions, cap_editions;

View File

@ -1,100 +0,0 @@
$OpenBSD: patch-src_demuxers_demux_qt_c,v 1.14 2011/10/09 20:45:07 sthen Exp $
- Add f4v/f4a file extensions to the Qt demuxer.
- Better support for 24-bit LPCM.
--- src/demuxers/demux_qt.c.orig Sat Jul 24 18:21:31 2010
+++ src/demuxers/demux_qt.c Wed Sep 28 04:09:22 2011
@@ -90,6 +90,7 @@ typedef unsigned int qt_atom;
#define WAVE_ATOM QT_ATOM('w', 'a', 'v', 'e')
#define FRMA_ATOM QT_ATOM('f', 'r', 'm', 'a')
#define AVCC_ATOM QT_ATOM('a', 'v', 'c', 'C')
+#define ENDA_ATOM QT_ATOM('e', 'n', 'd', 'a')
#define IMA4_FOURCC ME_FOURCC('i', 'm', 'a', '4')
#define MAC3_FOURCC ME_FOURCC('M', 'A', 'C', '3')
@@ -103,6 +104,8 @@ typedef unsigned int qt_atom;
#define TWOS_FOURCC ME_FOURCC('t', 'w', 'o', 's')
#define SOWT_FOURCC ME_FOURCC('s', 'o', 'w', 't')
#define RAW_FOURCC ME_FOURCC('r', 'a', 'w', ' ')
+#define IN24_FOURCC ME_FOURCC('i', 'n', '2', '4')
+#define NI42_FOURCC ME_FOURCC('4', '2', 'n', 'i')
#define AVC1_FOURCC ME_FOURCC('a', 'v', 'c', '1')
#define UDTA_ATOM QT_ATOM('u', 'd', 't', 'a')
@@ -1250,6 +1253,13 @@ static qt_error parse_trak_atom (qt_trak *trak,
trak->stsd_atoms[k].audio.channels = trak_atom[atom_pos + 0x15];
trak->stsd_atoms[k].audio.bits = trak_atom[atom_pos + 0x17];
+ /* 24-bit audio doesn't always declare itself properly, and can be big- or little-endian */
+ if (trak->stsd_atoms[k].audio.codec_fourcc == IN24_FOURCC) {
+ trak->stsd_atoms[k].audio.bits = 24;
+ if (_X_BE_32(&trak_atom[atom_pos + 0x48]) == ENDA_ATOM && trak_atom[atom_pos + 0x4D])
+ trak->stsd_atoms[k].audio.codec_fourcc = NI42_FOURCC;
+ }
+
/* assume uncompressed audio parameters */
trak->stsd_atoms[k].audio.bytes_per_sample =
trak->stsd_atoms[k].audio.bits / 8;
@@ -1312,11 +1322,13 @@ static qt_error parse_trak_atom (qt_trak *trak,
* appears to be a handler for uncompressed data; if there are an
* extra 0x10 bytes, there are some more useful decoding params;
* further, do not do load these parameters if the audio is just
- * PCM ('raw ', 'twos', or 'sowt') */
+ * PCM ('raw ', 'twos', 'sowt' or 'in24') */
if ((current_stsd_atom_size > 0x24) &&
(trak->stsd_atoms[k].audio.codec_fourcc != TWOS_FOURCC) &&
(trak->stsd_atoms[k].audio.codec_fourcc != SOWT_FOURCC) &&
- (trak->stsd_atoms[k].audio.codec_fourcc != RAW_FOURCC)) {
+ (trak->stsd_atoms[k].audio.codec_fourcc != RAW_FOURCC) &&
+ (trak->stsd_atoms[k].audio.codec_fourcc != IN24_FOURCC) &&
+ (trak->stsd_atoms[k].audio.codec_fourcc != NI42_FOURCC)) {
if (_X_BE_32(&trak_atom[atom_pos + 0x20]))
trak->stsd_atoms[k].audio.samples_per_packet =
@@ -2400,6 +2412,7 @@ static int demux_qt_send_chunk(demux_plugin_t *this_ge
buf_element_t *buf = NULL;
unsigned int i, j;
unsigned int remaining_sample_bytes;
+ unsigned int frame_aligned_buf_size;
int frame_duration;
int first_buf;
qt_trak *video_trak = NULL;
@@ -2655,9 +2668,15 @@ static int demux_qt_send_chunk(demux_plugin_t *this_ge
buf->pts = audio_trak->frames[i].pts;
}
- if (remaining_sample_bytes > buf->max_size)
- buf->size = buf->max_size;
+ /* 24-bit audio doesn't fit evenly into the default 8192-byte buffers */
+ if (audio_trak->properties->audio.bits == 24)
+ frame_aligned_buf_size = 8184;
else
+ frame_aligned_buf_size = buf->max_size;
+
+ if (remaining_sample_bytes > frame_aligned_buf_size)
+ buf->size = frame_aligned_buf_size;
+ else
buf->size = remaining_sample_bytes;
remaining_sample_bytes -= buf->size;
@@ -3255,7 +3274,7 @@ static const char *get_identifier (demux_class_t *this
}
static const char *get_extensions (demux_class_t *this_gen) {
- return "mov qt qtl mp4 m4a m4b";
+ return "mov qt qtl mp4 m4a m4b f4a f4v";
}
static const char *get_mimetypes (demux_class_t *this_gen) {
@@ -3263,8 +3282,8 @@ static const char *get_mimetypes (demux_class_t *this_
"video/x-quicktime: mov,qt: Quicktime animation;"
"audio/x-m4a: m4a,m4b: MPEG-4 audio;"
"application/x-quicktimeplayer: qtl: Quicktime list;"
- "video/mp4: mp4,mpg4: MPEG-4 video;"
- "audio/mp4: mp4,mpg4: MPEG-4 audio;";
+ "video/mp4: f4v,mp4,mpg4: MPEG-4 video;"
+ "audio/mp4: f4a,mp4,mpg4: MPEG-4 audio;";
}
static void class_dispose (demux_class_t *this_gen) {

View File

@ -1,39 +0,0 @@
$OpenBSD: patch-src_demuxers_demux_ts_c,v 1.2 2011/10/09 20:45:07 sthen Exp $
- Check boundaries during MPEG TS stream detection.
- Logic error with AC3 demuxer.
--- src/demuxers/demux_ts.c.orig Fri Apr 9 17:08:08 2010
+++ src/demuxers/demux_ts.c Wed Sep 28 01:47:17 2011
@@ -1438,7 +1438,7 @@ printf("Program Number is %i, looking for %i\n",progra
if (((stream[i] == 0x6a) || (stream[i] == 0x7a)) && (this->audio_tracks_count < MAX_AUDIO_TRACKS)) {
int j, found = 0;
for(j = 0; j < this->audio_tracks_count; j++) {
- if(this->audio_tracks[i].pid == pid) {
+ if(this->audio_tracks[j].pid == pid) {
found = 1;
break;
}
@@ -2360,18 +2360,20 @@ static demux_plugin_t *open_plugin (demux_class_t *cla
demux_ts_t *this;
int i;
int hdmv = -1;
+ int size;
switch (stream->content_detection_method) {
case METHOD_BY_CONTENT: {
uint8_t buf[2069];
- if (!_x_demux_read_header(input, buf, sizeof(buf)))
+ size = _x_demux_read_header(input, buf, sizeof(buf));
+ if (size < PKT_SIZE)
return NULL;
if (detect_ts(buf, sizeof(buf), PKT_SIZE))
hdmv = 0;
- else if (detect_ts(buf, sizeof(buf), PKT_SIZE+4))
+ else if (size >= PKT_SIZE + 4 && detect_ts(buf, sizeof(buf), PKT_SIZE+4))
hdmv = 1;
else
return NULL;

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-src_demuxers_ebml_c,v 1.3 2011/10/30 21:20:21 dcoppa Exp $
Fix NULL dereferences and skipping of unknown elements.
--- src/demuxers/ebml.c.orig Fri Oct 28 00:50:36 2011
+++ src/demuxers/ebml.c Fri Oct 28 00:52:43 2011
@@ -211,14 +211,13 @@ int ebml_skip(ebml_parser_t *ebml, ebml_elem_t *elem)
int ebml_read_elem_head(ebml_parser_t *ebml, ebml_elem_t *elem) {
- if (!ebml_read_elem_id(ebml, &elem->id))
- return 0;
+ int ret_id = ebml_read_elem_id(ebml, &elem->id);
- if (!ebml_read_elem_len(ebml, &elem->len))
- return 0;
+ int ret_len = ebml_read_elem_len(ebml, &elem->len);
elem->start = ebml->input->get_current_pos(ebml->input);
- return 1;
+
+ return (ret_id && ret_len);
}
@@ -473,6 +472,7 @@ int ebml_check_header(ebml_parser_t *ebml) {
default:
xprintf(ebml->xine, XINE_VERBOSITY_LOG,
"ebml: Unknown data type 0x%x in EBML header (ignored)\n", elem.id);
+ ebml_skip(ebml, &elem);
}
next_level = ebml_get_next_level(ebml, &elem);
}

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-src_demuxers_matroska_h,v 1.4 2011/10/13 07:27:00 dcoppa Exp $
--- src/demuxers/matroska.h.orig Thu Apr 29 13:05:21 2010
+++ src/demuxers/matroska.h Tue Oct 11 03:11:20 2011
@@ -272,6 +272,8 @@ struct matroska_track_s {
uint32_t codec_private_len;
int default_flag;
uint32_t compress_algo;
+ uint32_t compress_len;
+ char *compress_settings;
uint32_t buf_type;
fifo_buffer_t *fifo;
@@ -312,6 +314,7 @@ struct matroska_track_s {
#define MATROSKA_CODEC_ID_V_REAL_RV40 "V_REAL/RV40"
#define MATROSKA_CODEC_ID_V_MJPEG "V_MJPEG"
#define MATROSKA_CODEC_ID_V_THEORA "V_THEORA"
+#define MATROSKA_CODEC_ID_V_VP8 "V_VP8"
#define MATROSKA_CODEC_ID_A_MPEG1_L1 "A_MPEG/L1"
#define MATROSKA_CODEC_ID_A_MPEG1_L2 "A_MPEG/L2"

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-src_input_vcd_xineplug_inp_vcd_c,v 1.1 2011/05/11 09:05:54 dcoppa Exp $
Small memory leaks in VCD input plugin.
--- src/input/vcd/xineplug_inp_vcd.c.orig Mon May 9 20:44:31 2011
+++ src/input/vcd/xineplug_inp_vcd.c Mon May 9 20:45:22 2011
@@ -1525,6 +1525,10 @@ vcd_class_dispose (input_class_t *this_gen) {
dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT), "called\n");
vcd_close(class);
+ free(class->vcd_device);
+ free(my_vcd.v_config.title_format);
+ free(my_vcd.v_config.comment_format);
+ free(class);
}
/* Update the xine player title text. */

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-src_libsputext_demux_sputext_c,v 1.5 2011/05/11 09:05:54 dcoppa Exp $
Add .ass extension to be recognized as subtitle file.
--- src/libsputext/demux_sputext.c.orig Mon May 9 20:52:27 2011
+++ src/libsputext/demux_sputext.c Mon May 9 20:54:23 2011
@@ -1386,7 +1386,8 @@ static demux_plugin_t *open_demux_plugin (demux_class_
(strncasecmp(ending, ".sub", 4) != 0) &&
(strncasecmp(ending, ".srt", 4) != 0) &&
(strncasecmp(ending, ".smi", 4) != 0) &&
- (strncasecmp(ending, ".ssa", 4) != 0))) {
+ (strncasecmp(ending, ".ssa", 4) != 0) &&
+ (strncasecmp(ending, ".ass", 4) != 0))) {
free (this);
return NULL;
}
@@ -1432,7 +1433,7 @@ static const char *get_demux_identifier (demux_class_t
}
static const char *get_demux_extensions (demux_class_t *this_gen) {
- return "asc txt sub srt smi ssa";
+ return "asc txt sub srt smi ssa ass";
}
static const char *get_demux_mimetypes (demux_class_t *this_gen) {

View File

@ -1,115 +0,0 @@
$OpenBSD: patch-src_libxineadec_xine_lpcm_decoder_c,v 1.1 2011/10/09 20:45:07 sthen Exp $
- Better support for 24-bit LPCM.
- Fixed 20-bit BluRay PCM audio.
--- src/libxineadec/xine_lpcm_decoder.c.orig Tue Mar 9 17:17:05 2010
+++ src/libxineadec/xine_lpcm_decoder.c Wed Sep 28 01:22:20 2011
@@ -94,6 +94,7 @@ static void lpcm_decode_data (audio_decoder_t *this_ge
int stream_be;
audio_buffer_t *audio_buffer;
int format_changed = 0;
+ int special_dvd_audio = 0;
/* Drop preview data */
if (buf->decoder_flags & BUF_FLAG_PREVIEW)
@@ -115,7 +116,11 @@ static void lpcm_decode_data (audio_decoder_t *this_ge
num_channels = channels[(buf->decoder_info[2] >> (16+4)) & 0x0f];
switch ((buf->decoder_info[2] >> (24+6)) & 0x03) {
case 1: bits_per_sample = 16; break;
- case 2: bits_per_sample = 20; break;
+ case 2: /*bits_per_sample = 20; break;*/
+ /* fall thru. Samples are 0-padded to 24 bits, and
+ * converted later to 16 bits by dropping 8 lowest bits.
+ * this needs to be changed if audio out some day accepts 24bit samples.
+ */
case 3: bits_per_sample = 24; break;
default: bits_per_sample = 0; break;
}
@@ -152,7 +157,7 @@ static void lpcm_decode_data (audio_decoder_t *this_ge
switch ((buf->decoder_info[2]>>6) & 3) {
case 0: bits_per_sample = 16; break;
case 1: bits_per_sample = 20; break;
- case 2: bits_per_sample = 24; break;
+ case 2: bits_per_sample = 24; special_dvd_audio = 1; break;
}
}
@@ -270,35 +275,58 @@ static void lpcm_decode_data (audio_decoder_t *this_ge
int n = buf_size;
if ( stream_be ) {
- while (n >= 12) {
+ if (special_dvd_audio)
+ while (n >= 12) {
+ if ( stream_be == this->cpu_be ) {
+ *d++ = s[0];
+ *d++ = s[1];
+ *d++ = s[2];
+ *d++ = s[3];
+ *d++ = s[4];
+ *d++ = s[5];
+ *d++ = s[6];
+ *d++ = s[7];
+ } else {
+ *d++ = s[1];
+ *d++ = s[0];
+ *d++ = s[3];
+ *d++ = s[2];
+ *d++ = s[5];
+ *d++ = s[4];
+ *d++ = s[7];
+ *d++ = s[6];
+ }
+ s += 12;
+ n -= 12;
+ }
+ else
+ while (n >= 3) {
+ if ( stream_be == this->cpu_be ) {
+ *d++ = s[0];
+ *d++ = s[1];
+ } else {
+ *d++ = s[1];
+ *d++ = s[0];
+ }
+ s += 3;
+ n -= 3;
+ }
+ } else {
+ while (n >= 3) {
if ( stream_be == this->cpu_be ) {
- *d++ = s[0];
*d++ = s[1];
*d++ = s[2];
- *d++ = s[3];
- *d++ = s[4];
- *d++ = s[5];
- *d++ = s[6];
- *d++ = s[7];
} else {
- *d++ = s[1];
- *d++ = s[0];
- *d++ = s[3];
*d++ = s[2];
- *d++ = s[5];
- *d++ = s[4];
- *d++ = s[7];
- *d++ = s[6];
+ *d++ = s[1];
}
- s += 12;
- n -= 12;
+ s += 3;
+ n -= 3;
}
- } else {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "lpcm_decoder: I don't know what should decode lpcm 24bit little endian byte stream");
}
if ( (d - (uint8_t*)audio_buffer->mem)/2*3 < buf_size )
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "lpcm_decoder: lost %i bytes\n", (int)(buf_size - (d - (uint8_t*)audio_buffer->mem))/2*3);
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "lpcm_decoder: lost %i bytes of %i in the buffer\n", (int)(buf_size - (d - (uint8_t*)audio_buffer->mem)/2*3), buf_size);
} else {
memcpy (audio_buffer->mem, sample_buffer, buf_size);

View File

@ -1,12 +1,13 @@
$OpenBSD: patch-src_post_deinterlace_plugins_Makefile_in,v 1.9 2010/03/21 01:41:15 sthen Exp $
--- src/post/deinterlace/plugins/Makefile.in.orig Tue Feb 23 17:50:47 2010
+++ src/post/deinterlace/plugins/Makefile.in Tue Feb 23 19:29:58 2010
@@ -893,7 +893,7 @@ maintainer-clean-generic:
$OpenBSD: patch-src_post_deinterlace_plugins_Makefile_in,v 1.10 2011/11/16 00:43:17 sthen Exp $
--- src/post/deinterlace/plugins/Makefile.in.orig Sat Nov 12 20:37:30 2011
+++ src/post/deinterlace/plugins/Makefile.in Sat Nov 12 21:59:05 2011
@@ -899,9 +899,6 @@ maintainer-clean-generic:
-@echo "it deletes files that may require special tools to rebuild."
-rm -f Makefile.in
# Avoid "can't find register" failures with -O0, -O2, -O3 (gcc 4.0)
-# Avoid "can't find register" failures with -O0, -O2, -O3 (gcc 4.0)
-libdeinterlaceplugins_la-kdetv_greedyh.o libdeinterlaceplugins_la-kdetv_greedyh.lo: CFLAGS=$(shell echo @CFLAGS@ | sed -e 's/$$/ -O1/')
+# libdeinterlaceplugins_la-kdetv_greedyh.o libdeinterlaceplugins_la-kdetv_greedyh.lo: CFLAGS=$(shell echo @CFLAGS@ | sed -e 's/$$/ -O1/')
-
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,142 +0,0 @@
$OpenBSD: patch-src_post_planar_pp_c,v 1.1 2011/06/13 08:10:01 dcoppa Exp $
Eliminate use of old FFmpeg APIs.
--- src/post/planar/pp.c.orig Tue Mar 9 17:17:05 2010
+++ src/post/planar/pp.c Mon May 16 20:42:58 2011
@@ -35,6 +35,12 @@
# include <libpostproc/postprocess.h>
#endif
+#if LIBPOSTPROC_VERSION_MAJOR < 52
+# define pp_context pp_context_t
+# define pp_mode pp_mode_t
+# define PP_PARAMETERS_T
+#endif
+
#define PP_STRING_SIZE 256 /* size of pp mode string (including all options) */
/* plugin class initialization function */
@@ -76,14 +82,15 @@ struct post_plugin_pp_s {
/* libpostproc specific stuff */
int pp_flags;
- pp_context_t *pp_context;
- pp_mode_t *pp_mode;
+ pp_context *our_context;
+ pp_mode *our_mode;
pthread_mutex_t lock;
};
static int set_parameters (xine_post_t *this_gen, void *param_gen) {
+#ifdef PP_PARAMETERS_T
post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
pp_parameters_t *param = (pp_parameters_t *)param_gen;
@@ -92,17 +99,18 @@ static int set_parameters (xine_post_t *this_gen, void
memcpy( &this->params, param, sizeof(pp_parameters_t) );
pthread_mutex_unlock (&this->lock);
-
+#endif
return 1;
}
static int get_parameters (xine_post_t *this_gen, void *param_gen) {
+#ifdef PP_PARAMETERS_T
post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
pp_parameters_t *param = (pp_parameters_t *)param_gen;
memcpy( param, &this->params, sizeof(pp_parameters_t) );
-
+#endif
return 1;
}
@@ -202,8 +210,8 @@ static post_plugin_t *pp_open_plugin(post_class_t *cla
if(cpu_caps & MM_ACCEL_X86_3DNOW)
this->pp_flags |= PP_CPU_CAPS_3DNOW;
- this->pp_mode = NULL;
- this->pp_context = NULL;
+ this->our_mode = NULL;
+ this->our_context = NULL;
pthread_mutex_init (&this->lock, NULL);
@@ -248,13 +256,13 @@ static void pp_dispose(post_plugin_t *this_gen)
post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
if (_x_post_dispose(this_gen)) {
- if(this->pp_mode) {
- pp_free_mode(this->pp_mode);
- this->pp_mode = NULL;
+ if(this->our_mode) {
+ pp_free_mode(this->our_mode);
+ this->our_mode = NULL;
}
- if(this->pp_context) {
- pp_free_context(this->pp_context);
- this->pp_context = NULL;
+ if(this->our_context) {
+ pp_free_context(this->our_context);
+ this->our_context = NULL;
}
free(this);
}
@@ -304,7 +312,7 @@ static int pp_draw(vo_frame_t *frame, xine_stream_t *s
pthread_mutex_lock (&this->lock);
- if( !this->pp_context ||
+ if( !this->our_context ||
this->frame_width != yv12_frame->width ||
this->frame_height != yv12_frame->height ) {
@@ -312,32 +320,32 @@ static int pp_draw(vo_frame_t *frame, xine_stream_t *s
this->frame_height = yv12_frame->height;
pp_flags = this->pp_flags;
- if(this->pp_context)
- pp_free_context(this->pp_context);
+ if(this->our_context)
+ pp_free_context(this->our_context);
- this->pp_context = pp_get_context(frame->width, frame->height, pp_flags);
+ this->our_context = pp_get_context(frame->width, frame->height, pp_flags);
- if(this->pp_mode) {
- pp_free_mode(this->pp_mode);
- this->pp_mode = NULL;
+ if(this->our_mode) {
+ pp_free_mode(this->our_mode);
+ this->our_mode = NULL;
}
}
- if(!this->pp_mode)
- this->pp_mode = pp_get_mode_by_name_and_quality(this->params.mode,
+ if(!this->our_mode)
+ this->our_mode = pp_get_mode_by_name_and_quality(this->params.mode,
this->params.quality);
- if(this->pp_mode)
+ if(this->our_mode)
pp_postprocess(yv12_frame->base, yv12_frame->pitches,
out_frame->base, out_frame->pitches,
(frame->width+7)&(~7), frame->height,
NULL, 0,
- this->pp_mode, this->pp_context,
+ this->our_mode, this->our_context,
0 /*this->av_frame->pict_type*/);
pthread_mutex_unlock (&this->lock);
- if(this->pp_mode) {
+ if(this->our_mode) {
skip = out_frame->draw(out_frame, stream);
_x_post_frame_copy_up(frame, out_frame);
} else {

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-src_video_out_xxmc_h,v 1.1 2011/05/11 09:05:54 dcoppa Exp $
Fix building with recent videoproto.
--- src/video_out/xxmc.h.orig Mon May 9 20:29:04 2011
+++ src/video_out/xxmc.h Mon May 9 20:30:13 2011
@@ -77,11 +77,9 @@
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
+#include <X11/extensions/XvMClib.h>
#ifdef HAVE_VLDXVMC
#include <X11/extensions/vldXvMC.h>
-#else
- #include <X11/extensions/XvMClib.h>
- #include <X11/extensions/XvMC.h>
#endif
#define LOG_MODULE "video_out_xxmc"

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-src_xine-engine_Makefile_in,v 1.12 2010/03/21 01:41:15 sthen Exp $
--- src/xine-engine/Makefile.in.orig Tue Feb 23 17:50:50 2010
+++ src/xine-engine/Makefile.in Tue Feb 23 19:29:58 2010
@@ -462,7 +462,7 @@ libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) \
$OpenBSD: patch-src_xine-engine_Makefile_in,v 1.13 2011/11/16 00:43:17 sthen Exp $
--- src/xine-engine/Makefile.in.orig Sat Nov 12 20:37:32 2011
+++ src/xine-engine/Makefile.in Sat Nov 12 21:57:55 2011
@@ -469,7 +469,7 @@ libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) \
libxine_la_LIBADD = $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL) $(ZLIB_LIBS) \
-lm $(XINEUTILS_LIB) $(LTLIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-src_xine-engine_audio_decoder_c,v 1.11 2011/10/09 20:45:07 sthen Exp $
Fix audio crash.
--- src/xine-engine/audio_decoder.c.orig Wed Sep 28 01:38:57 2011
+++ src/xine-engine/audio_decoder.c Wed Sep 28 01:39:29 2011
@@ -283,6 +283,9 @@ static void *audio_decoder_loop (void *stream_gen) {
}
stream->audio_track_map[i] = buf->type;
stream->audio_track_map_entries++;
+ /* implicit channel change - reopen decoder below */
+ if ((i == 0) && (audio_channel_user == -1) && (stream->audio_channel_auto < 0))
+ stream->audio_decoder_streamtype = -1;
ui_event.type = XINE_EVENT_UI_CHANNELS_CHANGED;
ui_event.data_length = 0;

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-src_xine-engine_buffer_h,v 1.3 2011/10/09 20:45:07 sthen Exp $
--- src/xine-engine/buffer.h.orig Wed Sep 28 01:33:37 2011
+++ src/xine-engine/buffer.h Wed Sep 28 01:34:02 2011
@@ -189,6 +189,7 @@ extern "C" {
#define BUF_VIDEO_VC1 0x02650000
#define BUF_VIDEO_VMNC 0x02660000
#define BUF_VIDEO_SNOW 0x02670000
+#define BUF_VIDEO_VP8 0x02680000
/* audio buffer types: (please keep in sync with buffer_types.c) */

View File

@ -1,26 +0,0 @@
$OpenBSD: patch-src_xine-engine_buffer_types_c,v 1.1 2011/10/09 20:45:07 sthen Exp $
--- src/xine-engine/buffer_types.c.orig Tue Mar 23 11:46:03 2010
+++ src/xine-engine/buffer_types.c Wed Sep 28 04:09:58 2011
@@ -789,6 +789,14 @@ static const video_db_t video_db[] = {
BUF_VIDEO_SNOW,
"Snow"
},
+{
+ {
+ ME_FOURCC('V','P','8','0'),
+ 0
+ },
+ BUF_VIDEO_VP8,
+ "On2 VP8"
+},
{ { 0 }, 0, "last entry" }
};
@@ -826,6 +834,7 @@ static const audio_db_t audio_db[] = {
{
ME_FOURCC('t','w','o','s'),
ME_FOURCC('i','n','2','4'),
+ ME_FOURCC('4','2','n','i'),
0
},
BUF_AUDIO_LPCM_BE,

View File

@ -1,18 +0,0 @@
$OpenBSD: patch-src_xine-engine_configfile_c,v 1.2 2011/05/11 09:05:55 dcoppa Exp $
Using binary mode when checking configfile. New configfile would not be
written only when switching binaries for different platforms.
--- src/xine-engine/configfile.c.orig Sat Nov 13 13:39:27 2010
+++ src/xine-engine/configfile.c Sat Nov 13 13:39:59 2010
@@ -1012,8 +1012,8 @@ void xine_config_save (xine_t *xine, const char *filen
lprintf("backing up configfile to %s\n", temp);
- f_backup = fopen(temp, "w");
- f_config = fopen(filename, "r");
+ f_backup = fopen(temp, "wb");
+ f_config = fopen(filename, "rb");
if (f_config && f_backup && (stat(filename, &config_stat) == 0)) {
char *buf = NULL;

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-src_xine-engine_events_c,v 1.1 2011/05/11 09:05:55 dcoppa Exp $
Various small memory leaks in xine engine.
--- src/xine-engine/events.c.orig Mon May 9 20:34:15 2011
+++ src/xine-engine/events.c Mon May 9 20:36:34 2011
@@ -193,6 +193,7 @@ void xine_event_dispose_queue (xine_event_queue_t *que
while ( (event = xine_event_get (queue)) ) {
xine_event_free (event);
}
+ xine_list_delete(queue->events);
pthread_mutex_destroy(&queue->lock);
pthread_cond_destroy(&queue->new_event);

View File

@ -1,25 +0,0 @@
$OpenBSD: patch-src_xine-engine_info_helper_c,v 1.1 2011/05/11 09:05:55 dcoppa Exp $
Various small memory leaks in xine engine.
--- src/xine-engine/info_helper.c.orig Mon May 9 20:36:53 2011
+++ src/xine-engine/info_helper.c Mon May 9 20:38:25 2011
@@ -241,9 +241,6 @@ static void meta_info_set_unlocked_encoding(xine_strea
xprintf(stream->xine, XINE_VERBOSITY_LOG,
_("info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"), enc);
- if (system_enc)
- free(system_enc);
-
if (cd != (iconv_t)-1) {
char *utf8_value;
ICONV_CONST char *inbuf;
@@ -273,6 +270,8 @@ static void meta_info_set_unlocked_encoding(xine_strea
return;
}
}
+
+ free(system_enc);
}
#endif

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-src_xine-engine_post_c,v 1.1 2011/05/11 09:05:55 dcoppa Exp $
Do not copy pointer to acceleration data of a frame when propagating changes
downwards within post plugins because this corrupted the receiving frame
acceleration data.
--- src/xine-engine/post.c.orig Mon May 9 21:06:38 2011
+++ src/xine-engine/post.c Mon May 9 21:06:53 2011
@@ -424,7 +424,6 @@ void _x_post_frame_copy_down(vo_frame_t *from, vo_fram
to->progressive_frame = from->progressive_frame;
to->picture_coding_type = from->picture_coding_type;
to->drawn = from->drawn;
- to->accel_data = from->accel_data;
to->stream = from->stream;
to->crop_left = from->crop_left;
to->crop_right = from->crop_right;

View File

@ -1,73 +0,0 @@
$OpenBSD: patch-src_xine-engine_video_decoder_c,v 1.10 2011/05/11 09:05:55 dcoppa Exp $
- Avoid video clock errors due to decoder flush at discontinuity.
- Disable decoder flush at discontinuity to avoid decoding errors.
--- src/xine-engine/video_decoder.c.orig Mon May 9 20:56:04 2011
+++ src/xine-engine/video_decoder.c Mon May 9 21:02:28 2011
@@ -102,6 +102,11 @@ int _x_spu_decoder_sleep(xine_stream_t *stream, int64_
return thread_vacant;
}
+static void video_decoder_update_disable_flush_at_discontinuity(void *disable_decoder_flush_at_discontinuity, xine_cfg_entry_t *entry)
+{
+ *(int *)disable_decoder_flush_at_discontinuity = entry->num_value;
+}
+
static void *video_decoder_loop (void *stream_gen) {
buf_element_t *buf;
@@ -112,6 +117,7 @@ static void *video_decoder_loop (void *stream_gen) {
int prof_video_decode = -1;
int prof_spu_decode = -1;
uint32_t buftype_unknown = 0;
+ int disable_decoder_flush_at_discontinuity;
#ifndef WIN32
/* nice(-value) will fail silently for normal users.
@@ -127,6 +133,15 @@ static void *video_decoder_loop (void *stream_gen) {
if (prof_spu_decode == -1)
prof_spu_decode = xine_profiler_allocate_slot ("spu decoder");
+ disable_decoder_flush_at_discontinuity = stream->xine->config->register_bool(stream->xine->config, "engine.decoder.disable_flush_at_discontinuity", 0,
+ _("disable decoder flush at discontinuity"),
+ _("when watching live tv a discontinuity happens for example about every 26.5 hours due to a pts wrap.\n"
+ "flushing the decoder at that time causes decoding errors for images after the pts wrap.\n"
+ "to avoid the decoding errors, decoder flush at discontinuity should be disabled.\n\n"
+ "WARNING: as the flush was introduced to fix some issues when playing DVD still images, it is\n"
+ "likely that these issues may reappear in case they haven't been fixed differently meanwhile.\n"),
+ 20, video_decoder_update_disable_flush_at_discontinuity, &disable_decoder_flush_at_discontinuity);
+
while (running) {
lprintf ("getting buffer...\n");
@@ -307,10 +322,11 @@ static void *video_decoder_loop (void *stream_gen) {
if (stream->video_decoder_plugin) {
running_ticket->acquire(running_ticket, 0);
- /* it might be a long time before we get back from a discontinuity, so we better flush
- * the decoder before */
- stream->video_decoder_plugin->flush (stream->video_decoder_plugin);
stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin);
+ /* it might be a long time before we get back from a handle_video_discontinuity,
+ * so we better flush the decoder before */
+ if (!disable_decoder_flush_at_discontinuity)
+ stream->video_decoder_plugin->flush (stream->video_decoder_plugin);
running_ticket->release(running_ticket, 0);
}
@@ -323,10 +339,11 @@ static void *video_decoder_loop (void *stream_gen) {
if (stream->video_decoder_plugin) {
running_ticket->acquire(running_ticket, 0);
- /* it might be a long time before we get back from a discontinuity, so we better flush
- * the decoder before */
- stream->video_decoder_plugin->flush (stream->video_decoder_plugin);
stream->video_decoder_plugin->discontinuity (stream->video_decoder_plugin);
+ /* it might be a long time before we get back from a handle_video_discontinuity,
+ * so we better flush the decoder before */
+ if (!disable_decoder_flush_at_discontinuity)
+ stream->video_decoder_plugin->flush (stream->video_decoder_plugin);
running_ticket->release(running_ticket, 0);
}

View File

@ -1,165 +0,0 @@
$OpenBSD: patch-src_xine-engine_video_out_c,v 1.11 2011/10/09 20:45:07 sthen Exp $
- Disable decoder flush from video out to avoid decoding errors.
- Fixes two issues of video out standard cropping feature.
Resulting left and right cropping parameters should be multiple of 2.
Left cropping offset calculation to YUY2 frames fixed.
- Fix UI freeze.
- Fix video deadlock.
--- src/xine-engine/video_out.c.orig Wed Jul 21 13:43:52 2010
+++ src/xine-engine/video_out.c Wed Sep 28 01:45:14 2011
@@ -533,8 +533,8 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream
xine_list_iterator_t ite;
/* add cropping requested by frontend */
- img->crop_left += this->crop_left;
- img->crop_right += this->crop_right;
+ img->crop_left = (img->crop_left + this->crop_left) & ~1;
+ img->crop_right = (img->crop_right + this->crop_right) & ~1;
img->crop_top += this->crop_top;
img->crop_bottom += this->crop_bottom;
@@ -571,25 +571,28 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream
* check for first frame after seek and mark it
*/
img->is_first = 0;
- pthread_mutex_lock(&this->streams_lock);
- for (ite = xine_list_front(this->streams); ite;
- ite = xine_list_next(this->streams, ite)) {
- stream = xine_list_get_value(this->streams, ite);
- if (stream == XINE_ANON_STREAM) continue;
- pthread_mutex_lock (&stream->first_frame_lock);
- if (stream->first_frame_flag == 2) {
- if (this->grab_only) {
- stream->first_frame_flag = 0;
- pthread_cond_broadcast(&stream->first_frame_reached);
- } else
- stream->first_frame_flag = 1;
- img->is_first = FIRST_FRAME_MAX_POLL;
+ /* avoid a complex deadlock situation caused by net_buf_control */
+ if (!pthread_mutex_trylock(&this->streams_lock)) {
+ for (ite = xine_list_front(this->streams); ite;
+ ite = xine_list_next(this->streams, ite)) {
+ stream = xine_list_get_value(this->streams, ite);
+ if (stream == XINE_ANON_STREAM) continue;
+ pthread_mutex_lock (&stream->first_frame_lock);
+ if (stream->first_frame_flag == 2) {
+ if (this->grab_only) {
+ stream->first_frame_flag = 0;
+ pthread_cond_broadcast(&stream->first_frame_reached);
+ } else {
+ stream->first_frame_flag = 1;
+ }
+ img->is_first = FIRST_FRAME_MAX_POLL;
- lprintf ("get_next_video_frame first_frame_reached\n");
+ lprintf ("get_next_video_frame first_frame_reached\n");
+ }
+ pthread_mutex_unlock (&stream->first_frame_lock);
}
- pthread_mutex_unlock (&stream->first_frame_lock);
+ pthread_mutex_unlock(&this->streams_lock);
}
- pthread_mutex_unlock(&this->streams_lock);
if (!img_already_locked)
vo_frame_inc_lock( img );
@@ -801,7 +804,7 @@ static void expire_frames (vos_t *this, int64_t cur_vp
while (img) {
- if (img->is_first) {
+ if (img->is_first > 0) {
lprintf("expire_frames: first_frame !\n");
/*
@@ -818,6 +821,8 @@ static void expire_frames (vos_t *this, int64_t cur_vp
img->vpts = cur_vpts + FIRST_FRAME_POLL_DELAY;
}
img->is_first--;
+ /* make sure to wake up xine_play even if this first frame gets discarded */
+ if (img->is_first == 0) img->is_first = -1;
break;
}
@@ -847,6 +852,24 @@ static void expire_frames (vos_t *this, int64_t cur_vp
pthread_mutex_lock( &img->stream->current_extra_info_lock );
_x_extra_info_merge( img->stream->current_extra_info, img->extra_info );
pthread_mutex_unlock( &img->stream->current_extra_info_lock );
+ /* wake up xine_play now if we just discarded first frame */
+ if (img->is_first != 0) {
+ xine_list_iterator_t ite;
+ pthread_mutex_lock (&this->streams_lock);
+ for (ite = xine_list_front(this->streams); ite;
+ ite = xine_list_next(this->streams, ite)) {
+ xine_stream_t *stream = xine_list_get_value (this->streams, ite);
+ if (stream == XINE_ANON_STREAM) continue;
+ pthread_mutex_lock (&stream->first_frame_lock);
+ if (stream->first_frame_flag) {
+ stream->first_frame_flag = 0;
+ pthread_cond_broadcast (&stream->first_frame_reached);
+ }
+ pthread_mutex_unlock (&stream->first_frame_lock);
+ }
+ pthread_mutex_unlock(&this->streams_lock);
+ xine_log (this->xine, XINE_LOG_MSG, _("video_out: just discarded first frame after seek\n"));
+ }
}
/* when flushing frames, keep the first one as backup */
@@ -1124,6 +1147,11 @@ static void paused_loop( vos_t *this, int64_t vpts )
pthread_mutex_unlock( &this->free_img_buf_queue->mutex );
}
+static void video_out_update_disable_flush_from_video_out(void *disable_decoder_flush_from_video_out, xine_cfg_entry_t *entry)
+{
+ *(int *)disable_decoder_flush_from_video_out = entry->num_value;
+}
+
static void *video_out_loop (void *this_gen) {
int64_t vpts, diff;
@@ -1131,6 +1159,7 @@ static void *video_out_loop (void *this_gen) {
vos_t *this = (vos_t *) this_gen;
int64_t next_frame_vpts = 0;
int64_t usec_to_sleep;
+ int disable_decoder_flush_from_video_out;
#ifndef WIN32
/* nice(-value) will fail silently for normal users.
@@ -1141,6 +1170,16 @@ static void *video_out_loop (void *this_gen) {
nice(-2);
#endif /* WIN32 */
+ disable_decoder_flush_from_video_out = this->xine->config->register_bool(this->xine->config, "engine.decoder.disable_flush_from_video_out", 0,
+ _("disable decoder flush from video out"),
+ _("video out causes a decoder flush when video out runs out of frames for displaying,\n"
+ "because the decoder hasn't deliverd new frames for quite a while.\n"
+ "flushing the decoder causes decoding errors for images decoded after the flush.\n"
+ "to avoid the decoding errors, decoder flush at video out should be disabled.\n\n"
+ "WARNING: as the flush was introduced to fix some issues when playing DVD still images, it is\n"
+ "likely that these issues may reappear in case they haven't been fixed differently meanwhile.\n"),
+ 20, video_out_update_disable_flush_from_video_out, &disable_decoder_flush_from_video_out);
+
/*
* here it is - the heart of xine (or rather: one of the hearts
* of xine) : the video output loop
@@ -1191,7 +1230,7 @@ static void *video_out_loop (void *this_gen) {
ite = xine_list_next(this->streams, ite)) {
xine_stream_t *stream = xine_list_get_value(this->streams, ite);
if (stream == XINE_ANON_STREAM) continue;
- if (stream->video_decoder_plugin && stream->video_fifo) {
+ if (stream->video_decoder_plugin && stream->video_fifo && !disable_decoder_flush_from_video_out) {
buf_element_t *buf;
lprintf ("flushing current video decoder plugin\n");
@@ -1741,7 +1780,7 @@ static vo_frame_t * crop_frame( xine_video_port_t *thi
yuy2_to_yuy2(
/* src */
img->base[0] + img->crop_top * img->pitches[0] +
- img->crop_left/2, img->pitches[0],
+ img->crop_left*2, img->pitches[0],
/* dst */
dupl->base[0], dupl->pitches[0],
/* width x height */

View File

@ -1,49 +0,0 @@
$OpenBSD: patch-src_xine-engine_xine_c,v 1.13 2011/05/11 09:05:55 dcoppa Exp $
- Proper place for log mutex initialization. Fixed a leak.
- Various small memory leaks in xine engine.
--- src/xine-engine/xine.c.orig Thu Apr 29 12:55:02 2010
+++ src/xine-engine/xine.c Mon May 9 20:39:54 2011
@@ -654,6 +654,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init (&stream->frontend_lock, &attr);
+ pthread_mutexattr_destroy(&attr);
/*
* Clear meta/stream info
@@ -1488,6 +1489,8 @@ static void xine_dispose_internal (xine_stream_t *stre
stream->metronom->exit (stream->metronom);
+ xine_list_delete(stream->event_queues);
+
pthread_mutex_lock(&stream->xine->streams_lock);
ite = xine_list_find(stream->xine->streams, stream);
if (ite) {
@@ -1561,6 +1564,8 @@ void xine_exit (xine_t *this) {
if(this->port_ticket)
this->port_ticket->dispose(this->port_ticket);
+ pthread_mutex_destroy(&this->log_lock);
+
#if defined(WIN32)
WSACleanup();
#endif
@@ -1604,6 +1609,7 @@ xine_t *xine_new (void) {
* log buffers
*/
memset(this->log_buffers, 0, sizeof(this->log_buffers));
+ pthread_mutex_init (&this->log_lock, NULL);
#ifdef WIN32
@@ -1696,7 +1702,6 @@ void xine_init (xine_t *this) {
* locks
*/
pthread_mutex_init (&this->streams_lock, NULL);
- pthread_mutex_init (&this->log_lock, NULL);
/* initialize color conversion tables and functions */
init_yuv_conversion();

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.13 2011/05/11 09:05:55 dcoppa Exp $
@comment $OpenBSD: PLIST,v 1.14 2011/11/16 00:43:17 sthen Exp $
@conflict xine-lib-arts-*
@conflict xine-lib-esd-*
@conflict xine-lib-jack-*
@ -180,6 +180,7 @@ share/locale/es/LC_MESSAGES/libxine1.mo
share/locale/eu/LC_MESSAGES/libxine1.mo
share/locale/fr/LC_MESSAGES/libxine1.mo
share/locale/it/LC_MESSAGES/libxine1.mo
share/locale/ja/LC_MESSAGES/libxine1.mo
share/locale/pl/LC_MESSAGES/libxine1.mo
share/locale/pt_BR/LC_MESSAGES/libxine1.mo
share/locale/sk/LC_MESSAGES/libxine1.mo