<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/10/2015 5:58 PM, lvqcl wrote:<br>
    </div>
    <blockquote cite="mid:op.x9ftgiimcba0by@userhome-pc" type="cite">Erik
      de Castro Lopo wrote:
      <br>
      <blockquote type="cite">lvqcl,
        <br>
        <br>
        Would you be able to have alook at this one? I think its
        <br>
        Windows related:
        <br>
        <br>
            <a class="moz-txt-link-freetext" href="https://sourceforge.net/p/flac/feature-requests/114/">https://sourceforge.net/p/flac/feature-requests/114/</a>
        <br>
        <br>
      </blockquote>
      <br>
      The relevant changes are
      <br>
      <a class="moz-txt-link-rfc2396E" href="http://git.xiph.org/?p=flac.git;a=commitdiff;h=6a6207b52a86b1d7980a5233e297c0fc948bed7d">&lt;http://git.xiph.org/?p=flac.git;a=commitdiff;h=6a6207b52a86b1d7980a5233e297c0fc948bed7d&gt;</a>
      and
      <br>
<a class="moz-txt-link-rfc2396E" href="http://git.xiph.org/?p=flac.git;a=commitdiff;h=e8632477774f56b4fe7ccab525cad2ceab244b8a">&lt;http://git.xiph.org/?p=flac.git;a=commitdiff;h=e8632477774f56b4fe7ccab525cad2ceab244b8a&gt;</a>
      <br>
      <br>
      the current code:
      <br>
      <br>
      #ifdef _WIN32
      <br>
          /*
      <br>
           * Windows can suffer quite badly from disk fragmentation.
      This can be
      <br>
           * reduced significantly by setting the output buffer size to
      be 10MB.
      <br>
           */
      <br>
          setvbuf(file, NULL, _IOFBF, 10*1024*1024);
      <br>
      #endif
      <br>
      <br>
      <br>
      LRN <a class="moz-txt-link-rfc2396E" href="mailto:lrn1986@gmail.com">&lt;lrn1986@gmail.com&gt;</a> wrote:
      <br>
      <br>
      <blockquote type="cite">The commit mentioned in the feature
        request should not cause such
        <br>
        behaviour, as it only does short-lived operations (opens a file,
        does
        <br>
        stuff, closes the file immediately after) and is clearly
        distinguishing
        <br>
        between disk files and pipes (which is how you, presumably,
        stream data to
        <br>
        other processes for whatever reasons).
        <br>
        <br>
        I don't claim that FLAC doesn't do buffering, as the OP
        described, just
        <br>
        that this commit is unlikely to be the cause.
        <br>
      </blockquote>
      <br>
      Maybe you mean some other commit? For example,
      <br>
      <a class="moz-txt-link-rfc2396E" href="http://git.xiph.org/?p=flac.git;a=commitdiff;h=d66f6754bf94bc8ba23d3579d0b5650cd380c9f0">&lt;http://git.xiph.org/?p=flac.git;a=commitdiff;h=d66f6754bf94bc8ba23d3579d0b5650cd380c9f0&gt;</a>
      ?
      <br>
      Because setvbuf() should definitely change libFLAC behaviour
      regardless of files/pipes/etc.
      <br>
      <br>
      <br>
      The attached patch *should* resolve the issue. libFLAC will call
      setvbuf(file, ...)
      <br>
      only if GetFileType(...file...) == FILE_TYPE_DISK.<br>
    </blockquote>
    I probably don't know enough about the intricates of Win32, but why
    not prefer this for clarity:<br>
    <tt><br>
      diff --git a/src/libFLAC/stream_encoder.c
      b/src/libFLAC/stream_encoder.c<br>
      index 203a271..0394c26 100644<br>
      --- a/src/libFLAC/stream_encoder.c<br>
      +++ b/src/libFLAC/stream_encoder.c<br>
      @@ -1330,7 +1330,8 @@ static FLAC__StreamEncoderInitStatus
      init_FILE_internal_(<br>
               * Windows can suffer quite badly from disk fragmentation.
      This can be<br>
               * reduced significantly by setting the output buffer size
      to be 10MB.<br>
               */<br>
      -       setvbuf(file, NULL, _IOFBF, 10*1024*1024);<br>
      +       if(file != stdout)<br>
      +               setvbuf(file, NULL, _IOFBF, 10*1024*1024);<br>
       #endif<br>
              encoder-&gt;private_-&gt;file = file;<br>
      <br>
      Does libFLAC support other output types except for pipes/stdout
      and files?<br>
      <br>
      Also, if you want to be really evil you could even just use *else*
      and have the #ifdef _WIN32 block depend on the relative position
      to the if above...<br>
    </tt>
    <blockquote cite="mid:op.x9ftgiimcba0by@userhome-pc" type="cite"><br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
flac-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:flac-dev@xiph.org">flac-dev@xiph.org</a>
<a class="moz-txt-link-freetext" href="http://lists.xiph.org/mailman/listinfo/flac-dev">http://lists.xiph.org/mailman/listinfo/flac-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>