Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 1 of 1
  1. #1
    Senior Member ralphy's Avatar
    Join Date
    Jan 2006
    Location
    Canada
    Posts
    937

    Patch to enable WMA bitrate limiting for software players

    Here's a patch for LMS 7.8 that enables WMA bitrate limiting on players that don't support native WMA. (ie. SqueezeSlave, SqueezePlayer, iPeng, SqueezePlay, SoftSqueeze, etc).

    Instead of LMS streaming WMA as FLAC, which is nearly impossible over 3G, the server will transcode to mp3 at the bitrate limit set in the player settings, just like it does for all the other formats.

    I've tested the change using WMA internet radio streams, local WMA files and the Not So Sirius plugin in Canada.

    Hardware players with native wma decoding continue to receive the wma stream if the bit rate is below or equal to the players current bitrate limit setting.
    Code:
    --- Slim/Player/TranscodingHelper.pm.orig       2012-03-19 10:12:43.000000000 -0400
    +++ Slim/Player/TranscodingHelper.pm    2012-05-30 13:26:49.000000000 -0400
    @@ -569,10 +569,18 @@
     
            return 0 unless $maxRate;
     
    +       my $native = 0;
    +       foreach my $format ($client->formats()) {
    +               if (defined($type) && $type eq $format) {
    +                       $native = 1;
    +                       last;
    +               }
    +       }
    +
            # If the input type is mp3 or wma (bug 9641), we determine whether the 
    -       # input bitrate is under the maximum.
    +       # input bitrate is under the maximum, only if the player supports the format natively.
            # We presume that we won't choose an output format that violates the rate limit.
    -       if (defined($type) && ($type eq 'mp3' || $type eq 'wma')) {
    +       if (defined($type) && ($type eq 'mp3' || $type eq 'wma') && $native) {
                    return 0 if ($maxRate >= ($bitrate || 0)/1000);
            }
    Attached Files Attached Files
    Ralphy

    1-Touch, 4-Classics, 2-Booms, 2-Squeezeslaves, 3-Squeezeplays, 3-Squeezelites
    Squeezeslave donations always appreciated.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •