[rtmpdump] [PATCH] AMF Object Callback

Chris Larsen clarsen at euphoriaaudio.com
Sat Jul 30 00:15:13 CEST 2011


> Static global variables that might get manipulated from multiple threads
are absolutely forbidden. Changing the global library state like this is
forbidden. Doing 
> either of these things invites all kinds of crashes and other mysterious
problems.

> A patch that extends the RTMP structure might be acceptable. The AMF_Dump
function is primarily a debug function, you should not abuse it this way.

Good points. I moved the callback pointer to the RTMP struct as you said so
that it's thread safe. It is initialized to NULL when RTMP_Init() is called.
Then I moved the calls to the HandleInvoke and HandleMeta methods.
RTMP_Close() will NULL out the pointer and I added another method that an
app can call to explicitly release the callback. Please let me know what you
think and thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amf_callback_v2.patch
Type: application/octet-stream
Size: 2508 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20110729/6f20a002/attachment.obj>


More information about the rtmpdump mailing list