Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The issue is that you are "capturing" <code>initargs</code> via the use of the lambda expression.</p> <p>You shouldn't be reusing <code>initargs</code> in this way. Your code will be more readable and easier to maintain, and you will avoid this problem.</p> <p>So, first, use two different instances of <code>initargs</code>:</p> <pre><code>string initArgsWithScaleTwo = // ThreadPool.QueueUserWorkItem(o =&gt; pt.callExecute(initArgsWithScaleTwo)); string initArgsWithScaleFour = // ThreadPool.QueueUserWorkItem(o =&gt; pt.callExecute(initArgsWithScaleFour)); </code></pre> <p>Second, there's a lot of needless repetition when you assign to <code>initArgs</code>. That's not fun to maintain. This should get you started on a clearer version:</p> <pre><code>private string GetInitArgs( string filePath, int scale, int newHeight, string vidPathHigh, int scanLines ) { return "-i " + filePath + String.Format(" -vcodec wmv2 -qscale {0} -s ", scale) + newHeight + String.Format("x{0} -acodec wmav2 -ar 44100 -ab 128k -y \"" + pt.vidPathHigh + "\"", scanLines); } </code></pre> <p>You can do more and use <code>String.Format</code> to really clean the whole thing up.</p> <p>Then you can say</p> <pre><code>string initArgsWithScaleTwoAnd480ScanLines = GetInitArgs( pt.filePath, 2, (int)Math.Floor(480 * aspectRatio, pt.vidPathHigh, 480 ); </code></pre> <p>All that said, I don't understand why you are using threads at all if the threads are merely starting new processes. Just start the processes directly, and wait for them all to finish.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload