diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-12 17:26:37 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-07-12 17:40:55 +0100 |
commit | 56e5816252afbc7dd555c308ca678fce7ee584cc (patch) | |
tree | 12a0f61824f74ee14c137d8a2c7d18a6bf871415 /src/intel_video.c | |
parent | e30f0338fbf894fa3fdab20f4f9a97495cd341da (diff) |
video: Copy DummyEncoding into each adapter.
As we use the static DummyEncoding and may attempt to modify it for each
adaptor (on each device), we should use copies instead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_video.c')
-rw-r--r-- | src/intel_video.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/intel_video.c b/src/intel_video.c index 8be9dfb9..11fd7fad 100644 --- a/src/intel_video.c +++ b/src/intel_video.c @@ -128,7 +128,7 @@ static Atom xvSyncToVblank; #endif /* client libraries expect an encoding */ -static XF86VideoEncodingRec DummyEncoding[1] = { +static const XF86VideoEncodingRec DummyEncoding[1] = { { 0, "XV_IMAGE", @@ -423,16 +423,18 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen) OVERLAY_DEBUG("I830SetupImageVideoOverlay\n"); - if (!(adapt = calloc(1, sizeof(XF86VideoAdaptorRec) + - sizeof(intel_adaptor_private) + sizeof(DevUnion)))) + if (!(adapt = calloc(1, + sizeof(XF86VideoAdaptorRec) + + sizeof(intel_adaptor_private) + + sizeof(DevUnion)))) return NULL; adapt->type = XvWindowMask | XvInputMask | XvImageMask; adapt->flags = VIDEO_OVERLAID_IMAGES /*| VIDEO_CLIP_TO_VIEWPORT */ ; adapt->name = "Intel(R) Video Overlay"; adapt->nEncodings = 1; - adapt->pEncodings = DummyEncoding; - /* update the DummyEncoding for these two chipsets */ + adapt->pEncodings = xnfalloc(sizeof(DummyEncoding)); + memcpy(adapt->pEncodings, DummyEncoding, sizeof(DummyEncoding)); if (IS_845G(intel) || IS_I830(intel)) { adapt->pEncodings->width = IMAGE_MAX_WIDTH_LEGACY; adapt->pEncodings->height = IMAGE_MAX_HEIGHT_LEGACY; @@ -550,7 +552,8 @@ static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen) adapt->flags = 0; adapt->name = "Intel(R) Textured Video"; adapt->nEncodings = 1; - adapt->pEncodings = DummyEncoding; + adapt->pEncodings = xnfalloc(sizeof(DummyEncoding)); + memcpy(adapt->pEncodings, DummyEncoding, sizeof(DummyEncoding)); adapt->nFormats = NUM_FORMATS; adapt->pFormats = Formats; adapt->nPorts = nports; |