diff options
author | Eric Wong <e@80x24.org> | 2022-01-11 18:21:04 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-01-21 20:29:57 +0000 |
commit | bf9787ac517fe19af5fd6ba918a66b220fcbc923 (patch) | |
tree | e30cf4a74c599bb8037f41340fc1ed8800d8af4c /bin | |
parent | 88a8d4793473259b392241f1e2d20d39bd96b214 (diff) | |
download | dtas-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-x | bin/dtas-readahead | 7 |
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 |