| Summary: | Crash when more than one program use SDL at same time | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jeff Shanab <jshanab> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | jshanab42 |
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows 7 | ||
| Attachments: | Screenshot of backtrace and SDL code | ||
Created attachment 651 [details]
Screenshot of backtrace and SDL code
This doesn't make any sense to me. Why would the pointers to display modes be invalid in the second process? Did you have any luck tracking this one down? No response in 2 years, closing bug. Please feel free to reopen this bug if it's still active in the current snapshot: http://www.libsdl.org/tmp/SDL-2.0.zip Thanks! Sorry about the delay, I missed the interveaning notifications somehow. The issue is that browsers spawn a process but when the window is handed of the context (DX or GL) is no longer connected. Win 7 introduced a window class pool and while the pointer stays the same, the OS is free to return/reallocate from the pool. Things you attach to the window can get disconnected. Only solution for now has been to force the plugin to run "in process" Adobe Flash had this same problem and "fixed" it but they did not share how they fixed it. But this is why we do not support chrome browser at the moment, it allows such reassignment on scroll and resize and crashes. Let me know if there's anything SDL can do to help here. |
Attempting to start a second program using SDL-1.3 is failing in a simple init. App here is displaying yuv video using a streaming texture. When the second instance is called it fails in CreateRenderer as the attached backtrace shows. Windows 7 SDL-1.3 Cloned ~7/15 C++ code in a browser plugin playing video. Works fine in 14 threads in one process but fails in second process. basic init func: int ClassName::InitSDL() { if (SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError()); return -1; } UINT width = rect_.right - rect_.left; UINT height = rect_.bottom - rect_.top; window_ = SDL_CreateWindowFrom(wnd_); if (!window_) { fprintf(stderr, "Couldn't set create window: %s\n", SDL_GetError()); return -3; } renderer_ = SDL_CreateRenderer(window_, -1, SDL_RENDERER_ACCELERATED); if (!renderer_) { fprintf(stderr, "Couldn't set create renderer: %s\n", SDL_GetError()); return -4; } //wait for first frame to be decoded , need escape if (!started_) { scoped_lock lock(firstDecodeMutex_); firstDecodeCond_.wait(lock); } if (started_) { VideoTexture_ = SDL_CreateTexture(renderer_, SDL_PIXELFORMAT_YV12, SDL_TEXTUREACCESS_STREAMING, pCodecCtx_->width,pCodecCtx_->height); if (!VideoTexture_) { fprintf(stderr, "Couldn't set create texture: %s\n", SDL_GetError()); return -5; } initialized_ = true; } return 0; }