[xiph-commits] r9147 - experimental/giles/theora-exp-mt/lib

tterribe at motherfish-iii.xiph.org tterribe at motherfish-iii.xiph.org
Sat Apr 16 21:53:41 PDT 2005


Author: tterribe
Date: 2005-04-16 21:53:39 -0700 (Sat, 16 Apr 2005)
New Revision: 9147

Modified:
   experimental/giles/theora-exp-mt/lib/decode.c
Log:
Spawn one less thread.


Modified: experimental/giles/theora-exp-mt/lib/decode.c
===================================================================
--- experimental/giles/theora-exp-mt/lib/decode.c	2005-04-16 20:12:48 UTC (rev 9146)
+++ experimental/giles/theora-exp-mt/lib/decode.c	2005-04-17 04:53:39 UTC (rev 9147)
@@ -2073,7 +2073,7 @@
       avail_fragy0=avail_fragy_end=_dec->state.fplanes[0].nvfrags;
       notdone=stripe_fragy+pipe.mcu_nvfrags<avail_fragy_end;
       pthread_mutex_init(&lock, NULL);
-      for(pli=0;pli<3;pli++){
+      for(pli=3;pli-->0;){
         stripes[pli].dec = _dec;
         stripes[pli].pipe = &pipe;
         stripes[pli].refi = refi;
@@ -2084,10 +2084,13 @@
         stripes[pli].notstart = notstart;
         stripes[pli].notdone = notdone;
         stripes[pli].lock = &lock;
-	pthread_create(&threads[pli], NULL, oc_pipe_advance, 
-         (void*)&stripes[pli]);
+        if(pli>0){
+          pthread_create(&threads[pli], NULL, oc_pipe_advance, 
+           (void*)&stripes[pli]);
+        }
+        else oc_pipe_advance(stripes+pli);
       }
-      for(pli=0;pli<3;pli++)
+      for(pli=1;pli<3;pli++)
         pthread_join(threads[pli],NULL);
       if(_dec->stripe_cb.stripe_decoded!=NULL){
         /*Make the callback, ensuring we flip the sense of the "start" and



More information about the commits mailing list