aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/xvmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext/xvmain.c')
-rw-r--r--xorg-server/Xext/xvmain.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/xorg-server/Xext/xvmain.c b/xorg-server/Xext/xvmain.c
index 0b508611c..e0708b352 100644
--- a/xorg-server/Xext/xvmain.c
+++ b/xorg-server/Xext/xvmain.c
@@ -88,6 +88,7 @@ SOFTWARE.
#include "pixmapstr.h"
#include "gc.h"
#include "extnsionst.h"
+#include "extinit.h"
#include "dixstruct.h"
#include "resource.h"
#include "opaque.h"
@@ -507,19 +508,20 @@ XvdiDestroyEncoding(pointer value, XID id)
static int
XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
{
- xvEvent event;
XvVideoNotifyPtr pn;
dixLookupResourceByType((pointer *) &pn, pDraw->id, XvRTVideoNotifyList,
serverClient, DixReadAccess);
while (pn) {
+ xvEvent event = {
+ .u.videoNotify.reason = reason,
+ .u.videoNotify.time = currentTime.milliseconds,
+ .u.videoNotify.drawable = pDraw->id,
+ .u.videoNotify.port = pPort->id
+ };
event.u.u.type = XvEventBase + XvVideoNotify;
- event.u.videoNotify.time = currentTime.milliseconds;
- event.u.videoNotify.drawable = pDraw->id;
- event.u.videoNotify.port = pPort->id;
- event.u.videoNotify.reason = reason;
- WriteEventsToClient(pn->client, 1, (xEventPtr) & event);
+ WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
pn = pn->next;
}
@@ -530,18 +532,19 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
int
XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value)
{
- xvEvent event;
XvPortNotifyPtr pn;
pn = pPort->pNotify;
while (pn) {
+ xvEvent event = {
+ .u.portNotify.time = currentTime.milliseconds,
+ .u.portNotify.port = pPort->id,
+ .u.portNotify.attribute = attribute,
+ .u.portNotify.value = value
+ };
event.u.u.type = XvEventBase + XvPortNotify;
- event.u.portNotify.time = currentTime.milliseconds;
- event.u.portNotify.port = pPort->id;
- event.u.portNotify.attribute = attribute;
- event.u.portNotify.value = value;
- WriteEventsToClient(pn->client, 1, (xEventPtr) & event);
+ WriteEventsToClient(pn->client, 1, (xEventPtr) &event);
pn = pn->next;
}