We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1129

Summary: opengl renderer bug when compiled with VLC
Product: SDL Reporter: Vittorio Giovara <vitto.giova>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   
Attachments: the culprit source file

Description Vittorio Giovara 2011-02-17 00:16:39 UTC
Created attachment 576 [details]
the culprit source file

I'm trying to port the sdl+vlc example
(http://wiki.videolan.org/LibVLC_SampleCode_SDL) to SDL 1.3 apis
I'm trying to use this code to decode some h264 videos and to do some
compositing operation on it live.

The attached code works fine on Windows, i can see the video and render with the
new apis; it works using the direct3d and software renderer, with the
opengl renderer i see only a black screen.
However on Linux, using the opengl renderer, it gets a segfault and
crashes at the first frame or so (works fine with software renderer).

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe2da4700 (LWP 2995)]
0x00007ffff57e3629 in glGetError () from /usr/lib/nvidia-current/libGL.so.1
(gdb) bt
#0  0x00007ffff57e3629 in glGetError () from /usr/lib/nvidia-current/libGL.so.1
#1  0x00007ffff7b50533 in GL_UpdateTexture (renderer=<value optimized
out>, texture=0x88bda0, rect=0x8abfc4, pixels=0x7ffff2c29010,
pitch=7680) at src/render/opengl/SDL_render_gl.c:546
#2  0x00007ffff7b4c197 in SDL_UnlockTexture (texture=0x88bda0) at
src/render/SDL_render.c:732
#3  0x00000000004010d3 in unlock (data=0x7fffffffe0d0, id=0x0,
p_pixels=0x7fffe2da3bf0) at sdl13+vlc.c:26
#4  0x00007fffe2aa0c66 in Unlock (picture=<value optimized out>) at vmem.c:353
#5  0x00007ffff6c48532 in vout_display_Display (vout=0xa94f50,
now=<value optimized out>, deadline=<value optimized out>) at
../include/vlc_vout_wrapper.h:58
#6  ThreadDisplayRenderPicture (vout=0xa94f50, now=<value optimized
out>, deadline=<value optimized out>) at
video_output/video_output.c:1040
#7  ThreadDisplayPicture (vout=0xa94f50, now=<value optimized out>,
deadline=<value optimized out>) at video_output/video_output.c:1113
#8  0x00007ffff6c48ffd in ThreadManage (object=<value optimized out>)
at video_output/video_output.c:1125
#9  Thread (object=<value optimized out>) at video_output/video_output.c:1559
#10 0x00007ffff6ed4971 in start_thread (arg=<value optimized out>) at
pthread_create.c:304
#11 0x00007ffff765792d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()
Comment 1 Sam Lantinga 2013-05-21 02:07:10 UTC
Is this still active in the latest snapshot?
http://www.libsdl.org/tmp/SDL-2.0.zip
Comment 2 Ryan C. Gordon 2013-07-12 11:21:57 UTC
This looks like it's trying to do OpenGL calls in a background thread. Maybe set the context current on that thread and see if it helps?

--ryan.
Comment 3 Vittorio Giovara 2013-07-13 06:21:04 UTC
Will do try again soon.
Thanks.
Comment 4 Ryan C. Gordon 2015-02-18 03:26:37 UTC
I'm assuming this turned out to be GL calls on a background thread without a current context, and the latest SDL revisions should take care of this now (grep for "GL_ActivateRenderer" in the sources).

--ryan.