Bug 17950 - %w macros (stream seconds duration) returns negative value
: %w macros (stream seconds duration) returns negative value
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Transcoding
: 7.8.0
: All All
: -- normal (vote)
: 7.8.0
Assigned To: Alan Young
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-13 04:53 UTC by Alex Samorukov
Modified: 2012-04-16 23:00 UTC (History)
2 users (show)

See Also:
Category: Bug


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Samorukov 2012-04-13 04:53:31 UTC
While implementing ffmeg support for transcoding I found that with %w i am always getting negative values. Reason is bug in the TranscodingHelper.pm:

      foreach my $v (keys %vars) {
                my $value;
                
                if ($v eq 's') {$value = "$start";}
                elsif ($v eq 'u') {$value = "$end";}
                elsif ($v eq 't') {$value = Slim::Utils::DateTime::fracSecToMinSec($start);}
                elsif ($v eq 'v') {$value = Slim::Utils::DateTime::fracSecToMinSec($end);}
                elsif ($v eq 'w') {$value = $start - $end;}
                


It should be 

elsif ($v eq 'w') {$value = $end - $start;}


After fixing this I was able to utilize to use ffmpeg and implement cue+ape transcoding.
Comment 1 SVN Bot 2012-04-16 23:00:48 UTC
 == Auto-comment from SVN commit #33936 to the slim repo by ayoung ==
 == http://svn.slimdevices.com/slim?view=revision&revision=33936 ==

Fixed bug 17950: %w macros (stream seconds duration) returns negative value 

Duration is $end - $start instead of $start - $end (duh)