Benjamin Gretsch wrote:
You must not destroy a QThread that is running (see the QT book by trolltech).
Send the QThread object a signal that makes it's main loop exit, then wait
for the thread, then destroy it.
pseude code (not tested):
[snip]
Ben -
Thanks for the pointers. That basically removed the QThread errors
(destroyed before... etc) - but I had to also call "quit()" in my
QThread destructor to get the thread's event loop to shutdown. I'm not
doing a tight loop in the thread, rather, listening for incoming events
and doing decoding as needed. But your idea did fix the qthread errors.
However, since I'm at work (and the CentOS5 machine that was crashing is
at home), I can't test to see if the SIGSEGV problem is fixed as well -
probably is. Thanks for your help!
-josiah
Josiah Bryan schrieb:
Hey All -
I'm using Qt 4.5 and doing video decoding inside a QThread. When the
thread is destroyed, it goes through and frees up the libav* stuff its
allocated. One of the calls to av_free() in particular is causing a
SIGSEGV - with that call in, program SIGSEGV's, with that call commented
out, no sigsegv.
av_free(m_av_frame);
The odd thing is, right before I free m_av_frame(), I also use av_free()
on two other libav* structs.
m_av_frame is just allocated like this:
m_av_frame = avcodec_alloc_frame();
This is the frame that is given to avcodec_deocde_video(), then I
convert it to RGB32 using sws_scale() - so the data is completely
internal to the thread.
I've even tried wrapping the calls to av_free in a mutex - still sigsegvs.
To troubleshoot, I've tried gdb (only a single line stack trace on
sigsegv, location is "??" according to gdb.) I can't get valgrind's
helgrind tool working on my system, and I'm plum out of ideas on how to
troubleshoot this.
Any else have any ideas on how to troubleshoot?
Thanks!
-josiah
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
--
-=-=-=-=-=-=-=-=-=-=-=-=-
Josiah Bryan
Productive Concepts, Inc.
[email protected]
(765) 964-6009, ext. 224
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user