private static void FindPrimaryOutStreamIndex(CFolder folderInfo, out int primaryCoderIndex,
            out int primaryOutStreamIndex)
        {
            bool foundPrimaryOutStream = false;
            primaryCoderIndex = -1;
            primaryOutStreamIndex = -1;

            for (int outStreamIndex = 0, coderIndex = 0;
                 coderIndex < folderInfo.Coders.Count;
                 coderIndex++)
            {
                for (int coderOutStreamIndex = 0;
                     coderOutStreamIndex < folderInfo.Coders[coderIndex].NumOutStreams;
                     coderOutStreamIndex++, outStreamIndex++)
                {
                    if (folderInfo.FindBindPairForOutStream(outStreamIndex) < 0)
                    {
                        if (foundPrimaryOutStream)
                            throw new NotSupportedException("Multiple output streams.");

                        foundPrimaryOutStream = true;
                        primaryCoderIndex = coderIndex;
                        primaryOutStreamIndex = outStreamIndex;
                    }
                }
            }

            if (!foundPrimaryOutStream)
                throw new NotSupportedException("No output stream.");
        }
 private static void FindPrimaryOutStreamIndex(CFolder folderInfo, out int primaryCoderIndex, out int primaryOutStreamIndex)
 {
     bool flag = false;
     primaryCoderIndex = -1;
     primaryOutStreamIndex = -1;
     int outStreamIndex = 0;
     for (int i = 0; i < folderInfo.Coders.Count; i++)
     {
         int num3 = 0;
         while (num3 < folderInfo.Coders[i].NumOutStreams)
         {
             if (folderInfo.FindBindPairForOutStream(outStreamIndex) < 0)
             {
                 if (flag)
                 {
                     throw new NotSupportedException("Multiple output streams.");
                 }
                 flag = true;
                 primaryCoderIndex = i;
                 primaryOutStreamIndex = outStreamIndex;
             }
             num3++;
             outStreamIndex++;
         }
     }
     if (!flag)
     {
         throw new NotSupportedException("No output stream.");
     }
 }