From e2578cc0b9f8fb9b1eac1439ebe29bf3771cfefa Mon Sep 17 00:00:00 2001 From: Andreas Auras Date: Wed, 2 Mar 2011 13:52:31 +0100 Subject: 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. This issue occurs typically when a post plugin retrieves a new frame from the video out stage and then does a _x_post_frame_copy_down from the frame that is delivered from the video decoder. In this case the two frames are unrelated and acceleration data get messed up. --- src/xine-engine/post.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index 276934788..cb1da8acf 100644 --- a/src/xine-engine/post.c +++ b/src/xine-engine/post.c @@ -424,7 +424,6 @@ void _x_post_frame_copy_down(vo_frame_t *from, vo_frame_t *to) { 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; -- cgit v1.2.3 From 50f29760f6a8c99167f92c55f6732d4c99a8d017 Mon Sep 17 00:00:00 2001 From: Andreas Auras Date: Wed, 2 Mar 2011 15:06:42 +0100 Subject: 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. --- src/xine-engine/video_out.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index bd7333a0b..4d23b1b39 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -533,8 +533,8 @@ static int vo_frame_draw (vo_frame_t *img, xine_stream_t *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; @@ -1757,7 +1757,7 @@ static vo_frame_t * crop_frame( xine_video_port_t *this_gen, vo_frame_t *img ) { 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 */ -- cgit v1.2.3 From 2d5761c41570c2d70df7645299aa26be4ee34ec1 Mon Sep 17 00:00:00 2001 From: Andreas Auras Date: Wed, 2 Mar 2011 15:21:01 +0100 Subject: Recognize changes of cropping parameters within a frame and trigger recalculation of displayed window. This issue comes up when a post plugin only changes the cropping parameters of a frame without changing width, height or ratio of the frame. --- src/video_out/video_out_directfb.c | 10 +++++++--- src/video_out/video_out_vidix.c | 10 +++++++--- src/video_out/video_out_xcbxv.c | 6 +++++- src/video_out/video_out_xv.c | 6 +++++- src/video_out/video_out_xvmc.c | 6 +++++- src/video_out/video_out_xxmc.c | 6 +++++- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index 77f20a367..47ba056ae 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -701,9 +701,13 @@ static void directfb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen lprintf ("failed=0x%08x.\n", failed); } - if (this->sc.delivered_width != frame->width || - this->sc.delivered_height != frame->height || - this->sc.delivered_ratio != frame->ratio) + if ( (frame->width != this->sc.delivered_width) + || (frame->height != this->sc.delivered_height) + || (frame->ratio != this->sc.delivered_ratio) + || (frame->vo_frame.crop_left != this->sc.crop_left) + || (frame->vo_frame.crop_right != this->sc.crop_right) + || (frame->vo_frame.crop_top != this->sc.crop_top) + || (frame->vo_frame.crop_bottom != this->sc.crop_bottom) ) { { lprintf ("forcing redraw.\n"); this->sc.force_redraw = 1; diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c index 618ce1023..8298d3ede 100644 --- a/src/video_out/video_out_vidix.c +++ b/src/video_out/video_out_vidix.c @@ -648,9 +648,13 @@ static void vidix_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { pthread_mutex_lock(&this->mutex); if ( (frame->width != this->sc.delivered_width) - || (frame->height != this->sc.delivered_height) - || (frame->ratio != this->sc.delivered_ratio) - || (frame->format != this->delivered_format ) ) { + || (frame->height != this->sc.delivered_height) + || (frame->ratio != this->sc.delivered_ratio) + || (frame->format != this->delivered_format ) + || (frame->vo_frame.crop_left != this->sc.crop_left) + || (frame->vo_frame.crop_right != this->sc.crop_right) + || (frame->vo_frame.crop_top != this->sc.crop_top) + || (frame->vo_frame.crop_bottom != this->sc.crop_bottom) ) { lprintf("video_out_vidix: change frame format\n"); this->sc.delivered_width = frame->width; diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index e8797505b..f1ff843dc 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -710,7 +710,11 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { */ if ( (frame->width != this->sc.delivered_width) || (frame->height != this->sc.delivered_height) - || (frame->ratio != this->sc.delivered_ratio) ) { + || (frame->ratio != this->sc.delivered_ratio) + || (frame->vo_frame.crop_left != this->sc.crop_left) + || (frame->vo_frame.crop_right != this->sc.crop_right) + || (frame->vo_frame.crop_top != this->sc.crop_top) + || (frame->vo_frame.crop_bottom != this->sc.crop_bottom) ) { lprintf("frame format changed\n"); this->sc.force_redraw = 1; /* trigger re-calc of output size */ } diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 73236ec0d..1404871d4 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -802,7 +802,11 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { */ if ( (frame->width != this->sc.delivered_width) || (frame->height != this->sc.delivered_height) - || (frame->ratio != this->sc.delivered_ratio) ) { + || (frame->ratio != this->sc.delivered_ratio) + || (frame->vo_frame.crop_left != this->sc.crop_left) + || (frame->vo_frame.crop_right != this->sc.crop_right) + || (frame->vo_frame.crop_top != this->sc.crop_top) + || (frame->vo_frame.crop_bottom != this->sc.crop_bottom) ) { lprintf("frame format changed\n"); this->sc.force_redraw = 1; /* trigger re-calc of output size */ } diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index 34b925c8f..16d87c6b0 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -945,7 +945,11 @@ static void xvmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { if ( (frame->width != this->sc.delivered_width) || (frame->height != this->sc.delivered_height) - || (frame->ratio != this->sc.delivered_ratio) ) { + || (frame->ratio != this->sc.delivered_ratio) + || (frame->vo_frame.crop_left != this->sc.crop_left) + || (frame->vo_frame.crop_right != this->sc.crop_right) + || (frame->vo_frame.crop_top != this->sc.crop_top) + || (frame->vo_frame.crop_bottom != this->sc.crop_bottom) ) { lprintf("frame format changed\n"); /* diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 654cad7d9..6529d5832 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -1658,7 +1658,11 @@ static void xxmc_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) */ if ( (frame->width != this->sc.delivered_width) || (frame->height != this->sc.delivered_height) - || (frame->ratio != this->sc.delivered_ratio) ) { + || (frame->ratio != this->sc.delivered_ratio) + || (frame->vo_frame.crop_left != this->sc.crop_left) + || (frame->vo_frame.crop_right != this->sc.crop_right) + || (frame->vo_frame.crop_top != this->sc.crop_top) + || (frame->vo_frame.crop_bottom != this->sc.crop_bottom) ) { lprintf("frame format changed\n"); this->sc.force_redraw = 1; /* trigger re-calc of output size */ } -- cgit v1.2.3 From 5b09b3f35e568238c7c12f454a824c40de9825ea Mon Sep 17 00:00:00 2001 From: Andreas Auras Date: Wed, 2 Mar 2011 15:33:59 +0100 Subject: 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. --- src/xine-engine/video_decoder.c | 10 ++++------ src/xine-engine/video_out.c | 10 ++++------ 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 #include #include +#include #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 #include #include +#include #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, -- cgit v1.2.3