X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fos2thread.c;h=76dc0d56bca616b54e6e6b78b2d2f19576909d4d;hb=18c31f6ff8eef83cd19ea9e431335a854156dd18;hp=82fd22e8a0ee94dece2ae82c3a6302ac287d2c26;hpb=2029f312e8c13b25d322d69961b42db2e66f616a;p=ffmpeg diff --git a/libavcodec/os2thread.c b/libavcodec/os2thread.c index 82fd22e8a0e..76dc0d56bca 100644 --- a/libavcodec/os2thread.c +++ b/libavcodec/os2thread.c @@ -15,8 +15,7 @@ * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ //#define DEBUG @@ -40,7 +39,7 @@ typedef struct ThreadContext{ }ThreadContext; -void thread_func(void *v){ +void attribute_align_arg thread_func(void *v){ ThreadContext *c= v; for(;;){ @@ -62,7 +61,7 @@ void thread_func(void *v){ /** * free what has been allocated by avcodec_thread_init(). - * must be called after decoding has finished, especially dont call while avcodec_thread_execute() is running + * must be called after decoding has finished, especially do not call while avcodec_thread_execute() is running */ void avcodec_thread_free(AVCodecContext *s){ ThreadContext *c= s->thread_opaque; @@ -82,7 +81,7 @@ void avcodec_thread_free(AVCodecContext *s){ av_freep(&s->thread_opaque); } -int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count){ +int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){ ThreadContext *c= s->thread_opaque; int i; @@ -93,7 +92,7 @@ int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, vo for(i=0; ithread_count= thread_count; + if (thread_count <= 1) + return 0; + assert(!s->thread_opaque); c= av_mallocz(sizeof(ThreadContext)*thread_count); s->thread_opaque= c;