Andy’s Blog

Just another WordPress.com weblog

Linux Sol #2: MPlayer AF_INET6 Error

Linux Solution #2

Fixing MPlayer AF_INET6 Error

Due to the success of my previous post about fixing unmount problems I have decided another solution to a common problem is in order.

This information is supplied with ABSOLUTELY NO WARRANTY.

Please be careful when entering commands. Particularly ones you find on the Internet. Remember that anyone can post commands on the web so you should only run something if you know what it does. If in doubt use the manual. This is a good idea anyway as it can help improve your knowledge.

For more information about the commands listed use the Linux manual pages (accessed via the man command)

The Problem

When listening to remote streams using MPlayer an error message is displayed that reads: Couldn't resolve name for AF_INET6: example.com (shown below).

The cause of this error message is simple. There is a protocol called the Internet Protocol (IP) which is used to communicate on the Internet. It has two main versions IPv4 and IPv6. When MPlayer tries to turn a name (such as example.com) into an IP address it looks to see if it has an IPv6 address. If it can’t find one it switches to IPv4. However it issues an error message.

The Solution

As many sites do no use IPv6 you can instruct MPlayer not to try IPv6 unless it can’t use IPv4. To do this you can add the following line in MPlayer’s configuration file:
prefer-ipv4=yes

If you only want to make the change for the current user you can use the configuration file ~/.mplayer/config (where ~ is your home directory).

If you want to make this change for all users you can use the global configuration file /etc/mplayer/mplayer.conf or /usr/local/etc/mplayer/mplayer.conf. Which file you use depends on your Linux distribution.

Now MPlayer should not display an error message if it finds an IPv4 address but no IPv6 address.

You may have to close and reopen MPlayer for these changes to take effect.

Advertisements

April 6, 2008 Posted by | Computing, Linux, Software, Ubuntu | 1 Comment