Stop using Avisynth-MT

let’s start a vote, should I rename the blog “TheFluff’s list of things you shouldn’t be doing”? yes/no/maybe

  • Since the entire point of Avisynth is to load Avisynth plugins, and most Avisynth plugins sure as heck aren’t threadsafe, the efforts to try to make Avisynth-MT itself threadsafe are sort of meaningless. Not to mention they’ve failed spectacularly so far.
  • Nobody wants to have anything to do with the 64-bit version (or even make a trivial 64-bit wrapper) despite lots of threads requiring hilarious amounts of RAM.
  • Avisynth-MT uses Avisynth 2.5.6’s infamously memory leaking frame cache. Running out of memory is a Bad Thing, mmkay?
  • Avisynth-MT doesn’t handle system exceptions because someone commented out the original Avisynth code that did that forever ago and never replaced it.
  • In short, Avisynth-MT developers have no clue about what they’re doing.

Stop getting fooled by the ~blazing~ FPS numbers. An encode that crashes halfway through is effectively encoding at a negative FPS.

TL;DR: Pain is nature’s way of telling us “hey, stop fucking doing that, retard”. When nature does this, it usually has a good reason for doing so, and if you don’t listen, Bad Things will happen to you. Similarly, random crashes in a computer program are sorta your computer’s way of telling you “hey, stop fucking using that broken program, retard”.

Have a (sorta) relevant link

Who Needs Process?

This man explains why you should do what I told you to do two years ago, except he writes about software development rather than fagsubbing. He’s also more eloquent than I am.

Hope you enjoyed this blog post. well bye

I Am Mad About Channel Naming

HELLO FRIENDS
THE YEAR IS 2011; ALMOST 2012, IN FACT

Yet some of you fucking retards keep tagging channels as “D-CHANNELNAME”. That little D (stands for “digital”) makes me SO GODDAMNED ANGRY because it shows you idiots have no idea what the hell you’re dealing with, you’re just copying whatever shit People On The Internet are doing because it seems sorta cool. Japan finally turned off basically all analog television in July this year, and raws created with analog capping equipment haven’t been common even on Japanese P2P networks for several fucking years. There is no fucking need to distinguish that your precious raw is digital in origin, because it literally cannot be anything else.

tl;dr: GET WITH THE TIMES YOU GODDAMNED MONGOLOIDS. ANALOG RAWS BELONG IN 2005. MAYBE YOU SHOULD GO BACK THERE, SINCE YOU APPARENTLY LIKE THEM SO MUCH THAT YOU CANNOT STOP TRYING TO PRETEND THEY STILL EXIST.

Reasons to hate Avisynth

  • Since it’s based on VFW it’s permanently stuck in the 90’s
  • It isn’t threadsafe at all
  • It STILL doesn’t support high bitdepth YUV and won’t do so in 2.6 either, because colorspaces are handled in a retarded way
  • It uses a C++ interface and throws C++ exceptions across library boundaries
  • It doesn’t support VFR
  • It doesn’t support any sort of frame metadata at all, really
  • The codebase is absolutely insane and full of hilarious hacks and inline assembly
  • For something that is so adaptable it really is remarkably rigid and un-extendable
  • Part of the API is compiled into each and every plugin, resulting in a lot of funky issues
  • Despite being so shitty, it’s so useful that people keep hacking retarded things into it because they want to use it in new and funny ways
  • The source code repository uses CVS
  • It can only be compiled with MSVC 6.0 (or maybe they finally fixed this, idk)
  • Memory leaks, memory leaks everywhere
  • The scripting language lacks basic control structures, resulting in funny recursive calls to emulate loops
  • Most plugins are really fucking shitty

Contributions to this list are welcome.

Investigation of the /etc/hosts issues in OS X 10.7 (Lion)

I got bored today and decided to investigate the issues people have been having with their /etc/hosts entries in OS X 10.7.

A lot of people have reported a ton of random issues ranging from the hosts file not being consulted at all to odd issues with IPv6 and multiple addresses on the same line (see the comments in the linked article). I haven’t been able to reproduce much (probably because a lot of it depends on your DNS configuration), but there is one exception.

The .local domain is now reserved for the Bonjour service, and lookups for names under that top domain will now take exactly five seconds to time out before the hosts file is consulted. Or, well, almost. Applications whose underlying code use getaddrinfo(3) will behave that way, while ancient POSIXly things that use Ye Olde gethostbyname(3) will resolve immediately. This is why things like ping(1) don’t have that problem.

Interestingly, if you pass a hint argument to getaddrinfo, telling it you want an address in the PF_INET family, it’ll return immediately just like gethostbyname. I guess it’s possible that the delay is related to IPv6 funkiness (since PF_INET does not include PF_INET6 addresses).

You can test this yourself if you feel like it, assuming you have XCode installed. Compare the results of the two following programs:

gethostbyname

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

int main(int argc, char *argv[]) {
    if (argc <= 1) {
        printf("not enough arguments\n");
        return 1;
    }

    struct hostent *h = gethostbyname(argv[1]);
    if (h) {
        for (int i = 0; h->h_addr_list[i] != NULL; i++) {
            printf("%d.%d.%d.%d\n", h->h_addr_list[i][0], h->h_addr_list[i][1], h->h_addr_list[i][2], h->h_addr_list[i][3]);
        }
    }
    else {
        printf("host lookup failed\n");
        return 1;
    }

    return 0;
}

getaddrinfo

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>

int main(int argc, char *argv[]) {
    if (argc <= 1) {
        printf("not enough arguments\n");
        return 1;
    }

    struct addrinfo *res0, *res, hints;
    memset(&hints, 0, sizeof(hints));
    hints.ai_family = PF_UNSPEC;

    int ret = getaddrinfo(argv[1], NULL, &hints, &res0);
    if (ret) {
        printf("host lookup failed\n");
        return 1;
    }
    for (res = res0; res; res = res->ai_next) {
        struct sockaddr_in *saddr = (struct sockaddr_in*)res->ai_addr;
        printf("%s\n", inet_ntoa(saddr->sin_addr));
    }

    return 0;
}

Workaround

Someone suggested using DNSMasq as a workaround, but that seems overly complex to me. I suggest Ghost, which adds things to the Directory Service. If you don’t want to use a Ruby gem, you can manipulate the Directory Service directly with the command line utility dscl(1).