summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Auras <yak54@inkennet.de>2011-03-02 15:33:59 +0100
committerAndreas Auras <yak54@inkennet.de>2011-03-02 15:33:59 +0100
commit5b09b3f35e568238c7c12f454a824c40de9825ea (patch)
tree9a449ca68bb922150ef99f8bcd9f390ab0c3050a
parent2d5761c41570c2d70df7645299aa26be4ee34ec1 (diff)
downloadxine-lib-5b09b3f35e568238c7c12f454a824c40de9825ea.tar.gz
xine-lib-5b09b3f35e568238c7c12f454a824c40de9825ea.tar.bz2
Output a log message if raising of nice priority fails for video out and decoder thread.
Raising nice priority is not limited to root user only on modern unix/linux systems. So a log message about failure is helpful to everyone.
-rw-r--r--src/xine-engine/video_decoder.c10
-rw-r--r--src/xine-engine/video_out.c10
2 files changed, 8 insertions, 12 deletions
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index ef61edebd..b9d760b3f 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <errno.h>
#define XINE_ENGINE_INTERNAL
@@ -120,12 +121,9 @@ static void *video_decoder_loop (void *stream_gen) {
int disable_decoder_flush_at_discontinuity;
#ifndef WIN32
- /* nice(-value) will fail silently for normal users.
- * however when running as root this may provide smoother
- * playback. follow the link for more information:
- * http://cambuca.ldhs.cetuc.puc-rio.br/~miguel/multimedia_sim/
- */
- nice(-1);
+ errno = 0;
+ if (nice(-1) == -1 && errno)
+ xine_log(stream->xine, XINE_LOG_MSG, "video_decoder: can't raise nice priority by 1: %s\n", strerror(errno));
#endif /* WIN32 */
if (prof_video_decode == -1)
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 4d23b1b39..0bbf977f2 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -34,6 +34,7 @@
#include <pthread.h>
#include <inttypes.h>
#include <assert.h>
+#include <errno.h>
#define XINE_ENABLE_EXPERIMENTAL_FEATURES
#define XINE_ENGINE_INTERNAL
@@ -1139,12 +1140,9 @@ static void *video_out_loop (void *this_gen) {
int disable_decoder_flush_from_video_out;
#ifndef WIN32
- /* nice(-value) will fail silently for normal users.
- * however when running as root this may provide smoother
- * playback. follow the link for more information:
- * http://cambuca.ldhs.cetuc.puc-rio.br/~miguel/multimedia_sim/
- */
- nice(-2);
+ errno = 0;
+ if (nice(-2) == -1 && errno)
+ xine_log(this->xine, XINE_LOG_MSG, "video_out: can't raise nice priority by 2: %s\n", strerror(errno));
#endif /* WIN32 */
disable_decoder_flush_from_video_out = this->xine->config->register_bool(this->xine->config, "engine.decoder.disable_flush_from_video_out", 0,