Index: patches/to_upstream/23_thread_index.patch |
=================================================================== |
--- patches/to_upstream/23_thread_index.patch (revision 0) |
+++ patches/to_upstream/23_thread_index.patch (revision 0) |
@@ -0,0 +1,24 @@ |
+diff -wurp -N orig/libavcodec/pthread.c ffmpeg-mt/libavcodec/pthread.c |
+--- orig/libavcodec/pthread.c 2011-02-25 04:09:50.973123996 -0800 |
++++ ffmpeg-mt/libavcodec/pthread.c 2011-02-25 04:10:23.563063084 -0800 |
+@@ -448,9 +448,11 @@ int ff_thread_decode_frame(AVCodecContex |
+ if (err) return err; |
+ |
+ fctx->next_decoding++; |
++ int decoding_save = fctx->next_decoding; |
++ if (fctx->next_decoding >= thread_count) fctx->next_decoding = 0; |
+ |
+ if (fctx->delaying && avpkt->size) { |
+- if (fctx->next_decoding >= (thread_count-1)) fctx->delaying = 0; |
++ if (decoding_save >= (thread_count-1)) fctx->delaying = 0; |
+ |
+ *got_picture_ptr=0; |
+ return 0; |
+@@ -479,7 +481,6 @@ int ff_thread_decode_frame(AVCodecContex |
+ |
+ update_thread_context_from_copy(avctx, p->avctx, 1); |
+ |
+- if (fctx->next_decoding >= thread_count) fctx->next_decoding = 0; |
+ fctx->next_finished = returning_thread; |
+ |
+ return p->result; |