Barry Bouwsma
2004-Jun-08 06:17 UTC
[Vorbis] One final minor trivial insignificant pointless patch
[this address is IPv6-only, and usually doesn't work, so don't.] There's another patch I have up my sleeve, that it would be nice if I didn't need to apply it by hand. Look: vorbis-tools/oggenc/encode.c --- encode.c-DIST Fri Jul 19 08:35:48 2002 +++ encode.c Fri Jan 9 07:46:27 2004 @@ -346,7 +342,7 @@ seconds = (int)(remain_time - (double)((int)remain_time/60)*60); fprintf(stderr, "\r"); - fprintf(stderr, _("\t[%5.1f%%] [%2dm%.2ds remaining] %c"), + fprintf(stderr, _("\t[%5.1f%%] [%2dm%.2ds remaining] %c "), done*100.0/total, minutes, seconds, spinner[spinpoint++%4]); } What it does is to put a space at the end of the printed line, thereby erasing any character that may be left over. This happens when the value of minutes is more than 99, and it overflows %2d. When this number decrements from, say, 1000 to 999, without this hack, the original fprintf() will be one character shorter, leaving the twiddler at the end of the line. Then from 100 to 99, you've got two twiddlythingies. One could also change %2d to %8d or something so this would not be a problem, but how many characters do you want to reserve so that I take it as a challenge to record 10^(number-of-digits- plus-one) minutes and convert it? The above result looks fine. In the ogg playback with extended files, the carefully-formatted string can exceed 79 characters in some cases, which for me results in scrolling of the previous status line. I need to tackle this problem and come up with a more flexible format, but I haven't done so yet. When^H^H^H^HIf I do, you'll hear about it. thanks barry bouwsma
Monty
2004-Jul-19 10:20 UTC
[Vorbis] One final minor trivial insignificant pointless patch
On Tue, Jun 08, 2004 at 03:17:11PM +0200, Barry Bouwsma wrote: [...]> What it does is to put a space at the end of the printed line, > thereby erasing any character that may be left over.Committed. Monty