64d16dcfbd3b — Chris Cannam tip 2 months ago
Correct update of time in stream record - fixes failure to obtain a rate for stream using rate helper
1 files changed, 12 insertions(+), 13 deletions(-)

M blockstream-fn.sml
M blockstream-fn.sml +12 -13
@@ 556,19 556,18 @@ functor TransposedBlockStreamFn (S : BLO
         case upstream of
             NONE => NONE
           | SOME upstream =>
-            let val time = S.time upstream
-            in
-                case SeqMisc.unfoldln S.read (blocksize, upstream) of
-                    ([], _) => NONE
-                  | (blocks, sopt) =>
-                    SOME ({ rate = rate,
-                            channels = channels,
-                            blocksize = blocksize,
-                            time = time,
-                            upstream = sopt
-                          },
-                          M.fromColumns (map (fn m => M.row (m, 0)) blocks))
-            end
+            case SeqMisc.unfoldln S.read (blocksize, upstream) of
+                ([], _) => NONE
+              | (blocks, sopt) =>
+                SOME ({ rate = rate,
+                        channels = channels,
+                        blocksize = blocksize,
+                        time = case sopt of
+                                   NONE => time
+                                 | SOME s' => S.time s',
+                        upstream = sopt
+                      },
+                      M.fromColumns (map (fn m => M.row (m, 0)) blocks))
 
     fun foldl f = BlockStreamFolder.makeFoldl (read, f)