Re: [Gmerlin-general] bgav_start
Status: Beta
Brought to you by:
gmerlin
From: Burkhard P. <pl...@ip...> - 2009-08-27 12:00:54
|
Hi, august wrote > when I do bgav_start on two files in my threaded app, I sometimes > (98% of the time) get this: > > [NULL @ 0x7f479b059900]insufficient thread locking around > avcodec_open/close() > [track] Error: Starting video decoder for stream 1 failed > > > what does that mean? do I need to lock around bgav_ calls? It means that libavcodec has lots of tables as global variables (for saving memory) but it leaves proper locking to the caller. There would be 3 solutions (from best to worst): 1. libavcodec does the locking internally 2. gmerlin-avdecoder protects calls to avcodec_open/close() with a global mutex. This would be only a partial solution because one can e.g. decode with gmerlin-avdecoder and encode with libquicktime at the same time, both of them would be linked to libavcodec. 3. You make a global lock around calls to bgav_start() and bgav_close() and probably bgav_select_track(). As a temporary workaround (because I'm about to leave for a 2 weeks vacation) you can implement 3. When I'm back I can implement 2. Burkhard |