summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-01-05 15:41:57 +0100
committerJohns <johns98@gmx.net>2013-01-05 15:41:57 +0100
commit7e96a292eb4ec440e599d4f27aac4afcd4788369 (patch)
tree5c5eb29763821fbdcfa07a05b84f19cd2e8ea2bc
parentd89ada9aad29870ad08b503aac3e85d8bc36c2ff (diff)
downloadvdr-plugin-softhddevice-7e96a292eb4ec440e599d4f27aac4afcd4788369.tar.gz
vdr-plugin-softhddevice-7e96a292eb4ec440e599d4f27aac4afcd4788369.tar.bz2
First video surface clears complete window.
-rw-r--r--video.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/video.c b/video.c
index 99f9a49..463f9a0 100644
--- a/video.c
+++ b/video.c
@@ -5990,16 +5990,19 @@ static void VdpauDelHwDecoder(VdpauDecoder * decoder)
for (i = 0; i < VdpauDecoderN; ++i) {
if (VdpauDecoders[i] == decoder) {
VdpauDecoders[i] = NULL;
- VdpauDecoderN--;
- // FIXME: must copy last slot into empty slot and --
- break;
- }
- }
+ // copy last slot into empty slot
+ if (i < --VdpauDecoderN) {
+ VdpauDecoders[i] = VdpauDecoders[VdpauDecoderN];
+ }
- VdpauCleanup(decoder);
- VdpauPrintFrames(decoder);
+ VdpauCleanup(decoder);
+ VdpauPrintFrames(decoder);
+ free(decoder);
- free(decoder);
+ return;
+ }
+ }
+ Error(_("video/vdpau: decoder not in decoder list.\n"));
}
///
@@ -7652,8 +7655,9 @@ static void VdpauMixOsd(void)
/// Render video surface to output surface.
///
/// @param decoder VDPAU hw decoder
+/// @param level video surface level 0 = bottom
///
-static void VdpauMixVideo(VdpauDecoder * decoder)
+static void VdpauMixVideo(VdpauDecoder * decoder, int level)
{
VdpVideoSurface current;
VdpRect video_src_rect;
@@ -7666,10 +7670,17 @@ static void VdpauMixVideo(VdpauDecoder * decoder)
VdpauCheckAutoCrop(decoder);
#endif
- dst_rect.x0 = decoder->VideoX; // window output (clip)
- dst_rect.y0 = decoder->VideoY;
- dst_rect.x1 = decoder->VideoX + decoder->VideoWidth;
- dst_rect.y1 = decoder->VideoY + decoder->VideoHeight;
+ if (level) {
+ dst_rect.x0 = decoder->VideoX; // video window output (clip)
+ dst_rect.y0 = decoder->VideoY;
+ dst_rect.x1 = decoder->VideoX + decoder->VideoWidth;
+ dst_rect.y1 = decoder->VideoY + decoder->VideoHeight;
+ } else {
+ dst_rect.x0 = 0; // complete window (clip)
+ dst_rect.y0 = 0;
+ dst_rect.x1 = VideoWindowWidth;
+ dst_rect.y1 = VideoWindowHeight;
+ }
video_src_rect.x0 = decoder->CropX; // video source (crop)
video_src_rect.y0 = decoder->CropY;
@@ -7813,6 +7824,7 @@ static void VdpauBlackSurface(VdpauDecoder * decoder)
source_rect.x1 = 0;
source_rect.y1 = 0;
+ // FIXME: what happens with PIP?
if (0) {
// FIXME: wrong for radio channels
output_rect.x0 = decoder->OutputX; // video output (scale)
@@ -7938,7 +7950,7 @@ static void VdpauDisplayFrame(void)
continue;
}
- VdpauMixVideo(decoder);
+ VdpauMixVideo(decoder, i);
}
//