Bugzilla – Bug 10814
Transcoding Framework only replaces variable once (need global replace)
Last modified: 2009-10-09 18:44:10 UTC
It is not possible to use a variable more than one time in convert.conf files. For the BrutefirDRC plugin we need to replace the variables global. Prior the change to the transcoding framework all varialbes have been replaced global so I would file it as a bug. Example: flc flc * 00:04:20:06:b4:65 # F:{BITRATE=%d} [flac] -dcs --force-raw-format --endian=little --sign=signed -- $FILE$ | /usr/share/squeezecenter/Plugins/BrutefirDrc/brutefirwrapper 00:04:20:06:b4:65 /etc/squeezecenter/BrutefirDrc/settings/filter-00_04_20_06_b4_65 $BITRATE$ | [flac] -cs -0 --totally-silent --endian=little --sign=signed --channels=2 --bps=24 --sample-rate=$BITRATE$ - the second $BITRATE$ is not replaced. Solution posted by Alan: If you want to hack up a solution yourself, then just add a g to the variable substitution in TranscodingHelper.pm: Code: foreach (keys %subs) { $command =~ s/\$$_\$/$subs{$_}/; } with Code: foreach (keys %subs) { $command =~ s/\$$_\$/$subs{$_}/g; } reference to forum post with the problem: http://forums.slimdevices.com/showthread.php?p=372622#post372622
Please go ahead and commit this, Alan, per Dean's request.
Change 24769
This bug has been marked as fixed in the 7.4.0 release version of SqueezeBox Server! * SqueezeCenter: 28672 * Squeezebox 2 and 3: 130 * Transporter: 80 * Receiver: 65 * Boom: 50 * Controller: 7790 * Radio: 7790 Please see the Release Notes for all the details: http://wiki.slimdevices.com/index.php/Release_Notes If you haven't already, please download and install the new version from http://www.logitechsqueezebox.com/support/download-squeezebox-server.html If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
I am sorry I have to reopen the ticket. The mentioned Bugfix exists in the latest source but somehow the replacement does not work anymore. It did previously in the development version of 7.4.0 after I applied the patch manually. I am using the "%d" identifier to get the samplerate of the currently played file. This is needed for resampling. The example in the description is still correct (BITRATE should only be replaced by SAMPLERATE). But with the new version the replacement does not work at all. I.e. the first placeholder is replaced with nothing "", the second is leaved untouched. Is there anything that needs to be done to enable the samplerate replacement? Could it be that the samplerate is only set, if SBC decides that the client does not support the stream and needs resampled data? I can do test and provide more input, but right now I have no idea, what causes this problem.
%d is not the sample rate of the current file. It is the sample-rate to which it must be downsampled if the player does not support the sample-rate of the source file. It will be an empty string if down-sampling has not been determined to be required.
see the last comment from Alan, the issue is fixed and the problem is a misunderstanding about the useage of the "%d" placeholder.
Marking closed again