Bug 10814 - Transcoding Framework only replaces variable once (need global replace)
: Transcoding Framework only replaces variable once (need global replace)
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Transcoding
: 7.3.0
: All All
: P4 enhancement with 2 votes (vote)
: 7.4.0
Assigned To: Alan Young
http://forums.slimdevices.com/showthr...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-24 02:44 UTC by Klaas Prause
Modified: 2009-10-09 18:44 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaas Prause 2009-01-24 02:44:51 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
Comment 1 Chris Owens 2009-01-26 09:30:02 UTC
Please go ahead and commit this, Alan, per Dean's request.
Comment 2 Alan Young 2009-01-27 09:19:24 UTC
Change 24769
Comment 3 James Richardson 2009-10-05 14:26:18 UTC
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.
Comment 4 Klaas Prause 2009-10-08 00:59:54 UTC
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.
Comment 5 Alan Young 2009-10-09 02:14:09 UTC
%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.
Comment 6 Klaas Prause 2009-10-09 07:27:48 UTC
see the last comment from Alan, the issue is fixed and the problem is a misunderstanding about the useage of the "%d" placeholder.
Comment 7 Alan Young 2009-10-09 18:44:10 UTC
Marking closed again