MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / avcodec_thread_free

Function avcodec_thread_free

libavcodec/w32thread.c:75–94  ·  view source on GitHub ↗

* Free what has been allocated by avcodec_thread_init(). * Must be called after decoding has finished, especially do not call while avcodec_thread_execute() is running. */

Source from the content-addressed store, hash-verified

73 * Must be called after decoding has finished, especially do not call while avcodec_thread_execute() is running.
74 */
75void avcodec_thread_free(AVCodecContext *s){
76 ThreadContext *c= s->thread_opaque;
77 int i;
78
79 for(i=0; i<s->thread_count; i++){
80
81 c[i].func= NULL;
82 c[i].func2= NULL;
83 }
84 ReleaseSemaphore(c[0].work_sem, s->thread_count, 0);
85 for(i=0; i<s->thread_count; i++){
86 WaitForSingleObject(c[i].thread, INFINITE);
87 if(c[i].thread) CloseHandle(c[i].thread);
88 }
89 if(c[0].work_sem) CloseHandle(c[0].work_sem);
90 if(c[0].job_sem) CloseHandle(c[0].job_sem);
91 if(c[0].done_sem) CloseHandle(c[0].done_sem);
92
93 av_freep(&s->thread_opaque);
94}
95
96static int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){
97 ThreadContext *c= s->thread_opaque;

Callers 1

avcodec_thread_initFunction · 0.70

Calls 1

av_freepFunction · 0.85

Tested by

no test coverage detected