diff options
author | Torsten Jager <t.jager@gmx.de> | 2014-06-12 15:31:50 +0200 |
---|---|---|
committer | Torsten Jager <t.jager@gmx.de> | 2014-06-12 15:31:50 +0200 |
commit | 77eab79386f96852bed8f6fe04a799e36e0acfda (patch) | |
tree | fd95266e9c94f15fd866859a0f3fbe00d5a3c92d /src | |
parent | 203963c2ec316a080f4f8690033d7584fcc37e84 (diff) | |
download | xine-lib-77eab79386f96852bed8f6fe04a799e36e0acfda.tar.gz xine-lib-77eab79386f96852bed8f6fe04a799e36e0acfda.tar.bz2 |
ff_video_decoder: fix multithreading #6.
Make sure thread count is sane.
Diffstat (limited to 'src')
-rw-r--r-- | src/combined/ffmpeg/ff_video_decoder.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 6c0918007..b36075a4f 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -916,6 +916,10 @@ static void thread_count_cb(void *user_data, xine_cfg_entry_t *entry) { ff_video_class_t *class = (ff_video_class_t *) user_data; class->thread_count = entry->num_value; + if (class->thread_count < 1) + class->thread_count = 1; + else if (class->thread_count > 8) + class->thread_count = 8; } static void pp_quality_cb(void *user_data, xine_cfg_entry_t *entry) { @@ -2623,6 +2627,10 @@ void *init_video_plugin (xine_t *xine, void *data) { "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); + if (this->thread_count < 1) + this->thread_count = 1; + else if (this->thread_count > 8) + this->thread_count = 8; this->skip_loop_filter_enum = xine->config->register_enum(config, "video.processing.ffmpeg_skip_loop_filter", 0, (char **)skip_loop_filter_enum_names, |