From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 208.118.235.0/24 X-Spam-Status: No, score=-2.2 required=3.0 tests=AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: dtas-all@80x24.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id B67151FA7B for ; Sun, 10 May 2015 23:03:19 +0000 (UTC) Received: from localhost ([::1]:34776 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YraFj-0000WM-5Z for dtas-all@80x24.org; Sun, 10 May 2015 19:03:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YraFg-0000WG-1o for dtas-all@nongnu.org; Sun, 10 May 2015 19:03:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YraFc-00037T-Pp for dtas-all@nongnu.org; Sun, 10 May 2015 19:03:15 -0400 Received: from dcvr.yhbt.net ([64.71.152.64]:36664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YraFc-00036U-KO for dtas-all@nongnu.org; Sun, 10 May 2015 19:03:12 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B71391FA7B; Sun, 10 May 2015 23:03:11 +0000 (UTC) From: Eric Wong To: Subject: [PATCH] splitfx: fix lossy output with player command is in use Date: Sun, 10 May 2015 23:03:10 +0000 Message-Id: <1431298990-8733-1-git-send-email-e@80x24.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.71.152.64 Cc: Eric Wong X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+dtas-all=80x24.org@nongnu.org Sender: dtas-all-bounces+dtas-all=80x24.org@nongnu.org We must ensure lossy encodings do not get lossily-encoded twice, only once at the final stage. There is no effect for lossless outputs as lossless is the common case for splitfx users. --- lib/dtas/splitfx.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/dtas/splitfx.rb b/lib/dtas/splitfx.rb index a14d221..1de9229 100644 --- a/lib/dtas/splitfx.rb +++ b/lib/dtas/splitfx.rb @@ -173,6 +173,12 @@ class DTAS::SplitFX # :nodoc: outfmt = @infmt.dup outfmt.type = "flac" end + + # player commands will use SOXFMT by default, so we must output that + # as a self-describing format to the actual encoding instances + player_cmd = @command + suffix = outfmt.type + outfmt.type = 'sox' if player_cmd env = outfmt.to_env # set very high quality resampling if using 24-bit or higher output @@ -204,7 +210,7 @@ class DTAS::SplitFX # :nodoc: outarg = outfmt.to_sox_arg outarg << "-C#@compression" if @compression env["OUTFMT"] = xs(outarg) - env["SUFFIX"] = outfmt.type + env["SUFFIX"] = suffix env["OUTDIR"] = @outdir ? "#@outdir/".squeeze('/') : '' env.merge!(t.env) @@ -215,7 +221,7 @@ class DTAS::SplitFX # :nodoc: # already takes those into account. In other words, use our # target-specific commands like a dtas-player sink: # @command | (INFILE= FX= TRIMFX=; target['command']) - if player_cmd = @command + if player_cmd sub_env = { 'INFILE' => '-', 'FX' => '', 'TRIMFX' => '' } sub_env_s = sub_env.inject("") { |s,(k,v)| s << "#{k}=#{v} " } command = "#{player_cmd} | (#{sub_env_s}; #{command})" -- EW