about summary refs log tree commit homepage
path: root/bin
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-01-11 18:21:04 +0000
committerEric Wong <e@80x24.org>2022-01-21 20:29:57 +0000
commitbf9787ac517fe19af5fd6ba918a66b220fcbc923 (patch)
treee30cf4a74c599bb8037f41340fc1ed8800d8af4c /bin
parent88a8d4793473259b392241f1e2d20d39bd96b214 (diff)
downloaddtas-bf9787ac517fe19af5fd6ba918a66b220fcbc923.tar.gz
This ought to save some memory for dtas-player and
dtas-readahead users with multiple instances of the same
track(s) on their track list.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dtas-readahead7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/dtas-readahead b/bin/dtas-readahead
index 3f46b95..996142c 100755
--- a/bin/dtas-readahead
+++ b/bin/dtas-readahead
@@ -141,7 +141,7 @@ def do_open(path)
         buf << fp.read(fp.size - 4)
         Dir.chdir(File.dirname(path)) do
           yml = DTAS.yaml_load(buf)
-          x = yml['infile'] and return File.open(File.expand_path(x).freeze)
+          x = yml['infile'] and return File.open(-File.expand_path(x))
         end
       end
     end
@@ -158,9 +158,8 @@ begin
   cur = DTAS.yaml_load(c.req('current'))
   while @todo_ra > 0 && fp.nil?
     if current = cur['current']
-      track = current['infile']
+      track = -current['infile']
       break unless track.kind_of?(String)
-      track.freeze
       fp = work[track] ||= do_open(track)
       cur_pid = current['pid']
       if fp
@@ -197,7 +196,7 @@ begin
     repeat = c.req('tl repeat').split[-1]
     while @todo_ra > 0 && idx && (cid = ids[idx])
       fp = nil
-      track = c.req("tl get #{cid}").sub!(/\A1 \d+=/, '').freeze
+      track = -(c.req("tl get #{cid}").sub!(/\A1 \d+=/, ''))
       begin
         fp = work[track] ||= do_open(track)
       rescue SystemCallError