summaryrefslogtreecommitdiff
path: root/src/combined
diff options
context:
space:
mode:
Diffstat (limited to 'src/combined')
-rw-r--r--src/combined/ffmpeg/Makefile.am2
-rw-r--r--src/combined/ffmpeg/ff_audio_decoder.c2
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c67
-rw-r--r--src/combined/flac_decoder.c2
-rw-r--r--src/combined/flac_demuxer.c2
-rw-r--r--src/combined/nsf_combined.c2
-rw-r--r--src/combined/wavpack_combined.c2
-rw-r--r--src/combined/wavpack_combined.h2
-rw-r--r--src/combined/xine_speex_decoder.c12
-rw-r--r--src/combined/xine_theora_decoder.c2
-rw-r--r--src/combined/xine_vorbis_decoder.c2
11 files changed, 75 insertions, 22 deletions
diff --git a/src/combined/ffmpeg/Makefile.am b/src/combined/ffmpeg/Makefile.am
index ea900edba..13ec1a440 100644
--- a/src/combined/ffmpeg/Makefile.am
+++ b/src/combined/ffmpeg/Makefile.am
@@ -23,7 +23,7 @@ endif
nodist_xineplug_decode_ff_la_SOURCES = ffmpeg_config.h
xineplug_decode_ff_la_CFLAGS = $(AM_CFLAGS) $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
-xineplug_decode_ff_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) -lm $(ZLIB_LIBS) \
+xineplug_decode_ff_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) -lm $(ZLIB_LIBS) \
$(FFMPEG_LIBS) $(FFMPEG_POSTPROC_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
xineplug_decode_ff_la_LDFLAGS = $(AM_LDFLAGS) $(IMPURE_TEXT_LDFLAGS)
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c
index 6ad027a17..b7f966325 100644
--- a/src/combined/ffmpeg/ff_audio_decoder.c
+++ b/src/combined/ffmpeg/ff_audio_decoder.c
@@ -428,7 +428,7 @@ void *init_audio_plugin (xine_t *xine, void *data) {
return this;
}
-static uint32_t supported_audio_types[] = {
+static const uint32_t supported_audio_types[] = {
BUF_AUDIO_WMAV1,
BUF_AUDIO_WMAV2,
BUF_AUDIO_14_4,
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index d02074d91..8f6864ea1 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -60,6 +60,8 @@ typedef struct ff_video_class_s {
int pp_quality;
int thread_count;
+ int8_t skip_loop_filter_enum;
+ int8_t choose_speed_over_accuracy;
xine_t *xine;
} ff_video_class_t;
@@ -311,6 +313,24 @@ static const ff_codec_t ff_video_lookup[] = {
{BUF_VIDEO_THEORA_RAW, CODEC_ID_THEORA, "Theora (ffmpeg)"},
};
+static const char *const skip_loop_filter_enum_names[] = {
+ "default", /* AVDISCARD_DEFAULT */
+ "none", /* AVDISCARD_NONE */
+ "nonref", /* AVDISCARD_NONREF */
+ "bidir", /* AVDISCARD_BIDIR */
+ "nonkey", /* AVDISCARD_NONKEY */
+ "all", /* AVDISCARD_ALL */
+ NULL
+};
+
+static const int skip_loop_filter_enum_values[] = {
+ AVDISCARD_DEFAULT,
+ AVDISCARD_NONE,
+ AVDISCARD_NONREF,
+ AVDISCARD_BIDIR,
+ AVDISCARD_NONKEY,
+ AVDISCARD_ALL
+};
static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) {
size_t i;
@@ -355,6 +375,9 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type)
this->context->flags |= CODEC_FLAG_EMU_EDGE;
}
+ if (this->class->choose_speed_over_accuracy)
+ this->context->flags2 |= CODEC_FLAG2_FAST;
+
pthread_mutex_lock(&ffmpeg_lock);
if (avcodec_open (this->context, this->codec) < 0) {
pthread_mutex_unlock(&ffmpeg_lock);
@@ -371,6 +394,8 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type)
this->context->thread_count = this->class->thread_count;
}
+ this->context->skip_loop_filter = skip_loop_filter_enum_values[this->class->skip_loop_filter_enum];
+
pthread_mutex_unlock(&ffmpeg_lock);
lprintf("lavc decoder opened\n");
@@ -428,6 +453,18 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type)
}
+static void choose_speed_over_accuracy_cb(void *user_data, xine_cfg_entry_t *entry) {
+ ff_video_class_t *class = (ff_video_class_t *) user_data;
+
+ class->choose_speed_over_accuracy = entry->num_value;
+}
+
+static void skip_loop_filter_enum_cb(void *user_data, xine_cfg_entry_t *entry) {
+ ff_video_class_t *class = (ff_video_class_t *) user_data;
+
+ class->skip_loop_filter_enum = entry->num_value;
+}
+
static void thread_count_cb(void *user_data, xine_cfg_entry_t *entry) {
ff_video_class_t *class = (ff_video_class_t *) user_data;
@@ -1155,7 +1192,7 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
int got_one_picture = 0;
int offset = 0;
int codec_type = buf->type & 0xFFFF0000;
- int video_step_to_use;
+ int video_step_to_use = this->video_step;
/* pad input data */
/* note: bitstream, alt bitstream reader or something will cause
@@ -1555,14 +1592,32 @@ void *init_video_plugin (xine_t *xine, void *data) {
_("You can adjust the number of video decoding threads which FFmpeg may use.\n"
"Higher values should speed up decoding but it depends on the codec used "
"whether parallel decoding is supported. A rule of thumb is to have one "
- "decoding thread per logical CPU (typically 1 to 4). A change will take "
- "effect with playing the next stream."),
+ "decoding thread per logical CPU (typically 1 to 4).\n"
+ "A change of this setting will take effect with playing the next stream."),
10, thread_count_cb, this);
+ this->skip_loop_filter_enum = xine->config->register_enum(config, "video.processing.ffmpeg_skip_loop_filter", 0,
+ (char **)skip_loop_filter_enum_names,
+ _("Skip loop filter"),
+ _("You can control for which frames the loop filter shall be skipped after "
+ "decoding.\n"
+ "Skipping the loop filter will speedup decoding but may lead to artefacts. "
+ "The number of frames for which it is skipped increases from 'none' to 'all'. "
+ "The default value leaves the decision up to the implementation.\n"
+ "A change of this setting will take effect with playing the next stream."),
+ 10, skip_loop_filter_enum_cb, this);
+
+ this->choose_speed_over_accuracy = xine->config->register_bool(config, "video.processing.ffmpeg_choose_speed_over_accuracy", 0,
+ _("Choose speed over specification compliance"),
+ _("You may want to allow speed cheats which violate codec specification.\n"
+ "Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+ "A change of this setting will take effect with playing the next stream."),
+ 10, choose_speed_over_accuracy_cb, this);
+
return this;
}
-static uint32_t supported_video_types[] = {
+static const uint32_t supported_video_types[] = {
BUF_VIDEO_MSMPEG4_V1,
BUF_VIDEO_MSMPEG4_V2,
BUF_VIDEO_MSMPEG4_V3,
@@ -1641,12 +1696,12 @@ static uint32_t supported_video_types[] = {
0
};
-static uint32_t wmv8_video_types[] = {
+static const uint32_t wmv8_video_types[] = {
BUF_VIDEO_WMV8,
0
};
-static uint32_t wmv9_video_types[] = {
+static const uint32_t wmv9_video_types[] = {
BUF_VIDEO_WMV9,
0
};
diff --git a/src/combined/flac_decoder.c b/src/combined/flac_decoder.c
index 40c5fa6a3..43bad327e 100644
--- a/src/combined/flac_decoder.c
+++ b/src/combined/flac_decoder.c
@@ -396,7 +396,7 @@ init_plugin (xine_t *xine, void *data) {
void *demux_flac_init_class (xine_t *xine, void *data);
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_FLAC, 0
};
diff --git a/src/combined/flac_demuxer.c b/src/combined/flac_demuxer.c
index 1f390a86f..bab42876c 100644
--- a/src/combined/flac_demuxer.c
+++ b/src/combined/flac_demuxer.c
@@ -53,7 +53,7 @@
#include <xine/xine_internal.h>
#include <xine/xineutils.h>
-#include "../demuxers/demux.h"
+#include <xine/demux.h>
#ifndef LEGACY_FLAC
# define FLAC__SeekableStreamDecoder FLAC__StreamDecoder
diff --git a/src/combined/nsf_combined.c b/src/combined/nsf_combined.c
index 18ab05863..0364e2db2 100644
--- a/src/combined/nsf_combined.c
+++ b/src/combined/nsf_combined.c
@@ -25,7 +25,7 @@ static const demuxer_info_t demux_info_nsf = {
10 /* priority */
};
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_NSF,
0
};
diff --git a/src/combined/wavpack_combined.c b/src/combined/wavpack_combined.c
index edf4bec01..8a4b488ae 100644
--- a/src/combined/wavpack_combined.c
+++ b/src/combined/wavpack_combined.c
@@ -27,7 +27,7 @@ static const demuxer_info_t demux_info_wv = {
0 /* priority */
};
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_WAVPACK, 0
};
diff --git a/src/combined/wavpack_combined.h b/src/combined/wavpack_combined.h
index 264609bf2..42b0bfd51 100644
--- a/src/combined/wavpack_combined.h
+++ b/src/combined/wavpack_combined.h
@@ -20,7 +20,7 @@
* xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
*/
-#include "os_types.h"
+#include <xine/os_types.h>
#include "bswap.h"
typedef struct {
diff --git a/src/combined/xine_speex_decoder.c b/src/combined/xine_speex_decoder.c
index a94ab0c0e..865232e30 100644
--- a/src/combined/xine_speex_decoder.c
+++ b/src/combined/xine_speex_decoder.c
@@ -92,8 +92,8 @@ static void speex_discontinuity (audio_decoder_t *this_gen) {
}
/* Known speex comment keys from ogg123 sources*/
-static struct {
- char *key; /* includes the '=' for programming convenience */
+static const struct {
+ char key[16]; /* includes the '=' for programming convenience */
int xine_metainfo_index;
} speex_comment_keys[] = {
{"ARTIST=", XINE_META_INFO_ARTIST},
@@ -101,8 +101,7 @@ static struct {
{"TITLE=", XINE_META_INFO_TITLE},
{"GENRE=", XINE_META_INFO_GENRE},
{"DESCRIPTION=", XINE_META_INFO_COMMENT},
- {"DATE=", XINE_META_INFO_YEAR},
- {NULL, 0}
+ {"DATE=", XINE_META_INFO_YEAR}
};
#define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \
@@ -169,8 +168,7 @@ void read_metadata (speex_decoder_t *this, char * comments, int length)
printf ("\n");
#endif
- for (i = 0; speex_comment_keys[i].key != NULL; i++) {
-
+ for (i = 0; i < (sizeof(speex_comment_keys)/sizeof(speex_comment_keys[0])); i++) {
if ( !strncasecmp (speex_comment_keys[i].key, c,
strlen(speex_comment_keys[i].key)) ) {
int keylen = strlen(speex_comment_keys[i].key);
@@ -390,7 +388,7 @@ void *speex_init_plugin (xine_t *xine, void *data) {
return this;
}
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_SPEEX, 0
};
diff --git a/src/combined/xine_theora_decoder.c b/src/combined/xine_theora_decoder.c
index 262cb5414..96d4ca8f0 100644
--- a/src/combined/xine_theora_decoder.c
+++ b/src/combined/xine_theora_decoder.c
@@ -361,7 +361,7 @@ void *theora_init_plugin (xine_t *xine, void *data) {
* exported plugin catalog entry
*/
-static uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 };
+static const uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 };
const decoder_info_t dec_info_theora = {
supported_types, /* supported types */
diff --git a/src/combined/xine_vorbis_decoder.c b/src/combined/xine_vorbis_decoder.c
index 143c761c4..6d651f153 100644
--- a/src/combined/xine_vorbis_decoder.c
+++ b/src/combined/xine_vorbis_decoder.c
@@ -324,7 +324,7 @@ void *vorbis_init_plugin (xine_t *xine, void *data) {
return this;
}
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_VORBIS, 0
};