mpenkov / ffmpeg-tutorial

A set of tutorials that demonstrates how to write a video player based on FFmpeg
http://www.ffmpeg.org/documentation.html
1.22k stars 395 forks source link

segmentation fault when running tutorial4 or any other after that #26

Open pawan9 opened 9 years ago

pawan9 commented 9 years ago

The tutorials are compiling fine but I am getting segmentation fault error when running tutorial4 it or any other tutorials after that.

gdb backtrace

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x1813 of process 84136] 0x00007fff955d4432 in stack_not_16_byte_aligned_error () from /usr/lib/system/libdyld.dylib (gdb) backtrace

0 0x00007fff955d4432 in stack_not_16_byte_aligned_error ()

from /usr/lib/system/libdyld.dylib

1 0x000000010a2f1ee0 in ?? ()

2 0x0000000101341008 in ?? () from /usr/local/lib/libSDL-1.2.0.dylib

3 0x00000000000005d0 in ?? ()

4 0x00000001013362e9 in RunThread () from /usr/local/lib/libSDL-1.2.0.dylib

5 0x00000001013362e2 in RunThread () from /usr/local/lib/libSDL-1.2.0.dylib

6 0x00007fff8d1d4268 in ?? () from /usr/lib/system/libsystem_pthread.dylib

7 0x0000000000006f23 in ?? ()

8 0x000000010a2f2000 in ?? ()

9 0x000000010a2f1f50 in ?? ()

10 0x00007fff8d1d41e5 in ?? () from /usr/lib/system/libsystem_pthread.dylib

11 0x0000000000000000 in ?? ()

(gdb)

Is seems like it is related to the sdl library. How do i resolve it.

here is the link to the valgring output(was just playing around with it) (http://pastebin.com/1HFrwP5W) maybe this can help find the problem.

fugokidi commented 8 years ago

@pawan9 Did you solve the segmentation fault problem? I'm also having the same problem. May I know if you have solved it, thank you.

houshunwei commented 8 years ago

i got the same problem on mac 10.11

But what amazing: use tutorial04 in this repository, it's ok now!

fugokidi commented 8 years ago

@houshunwei I tried it long time ago. Try to put the following line in the decode_thread() function. pFormatCtx = avformat_alloc_context();