Bug report: Playing wma files... inc. the solution!


as seen before, I was having a problem with playing .wma files on gentoo. Following is all the information:

emerge --info:
Portage (default/linux/amd64/2008.0, gcc-4.3.2, glibc-2.9_p20081201-r1, 2.6.28-gentoo x86_64)
System uname: Linux-2.6.28-gentoo-x86_64-AMD_Turion-tm-_64_X2_Mobile_Technology_TL-60-with-glibc2.2.5
Timestamp of tree: Tue, 13 Jan 2009 11:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash: 3.2_p48
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python: 2.5.2-r8
dev-util/ccache: 2.4-r8
sys-apps/baselayout: 2.0.0
sys-apps/openrc: 0.4.1-r1
sys-apps/sandbox: 1.3.2
sys-devel/autoconf: 2.13, 2.63
sys-devel/automake: 1.4_p6, 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils: 2.19
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool: 2.2.6a
virtual/os-headers: 2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O2 -march=athlon64 -msse3 -frename-registers -fweb -pipe -fomit-frame-pointer -fno-ident"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=athlon64 -msse3 -frename-registers -fweb -pipe -fomit-frame-pointer -fno-ident"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="en de"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/usr/local/overlays/conrad /usr/local/portage"
USE="3dnow X acl acpi alsa amd64 bash-completion berkdb bzip2 cdr cli cracklib crypt dbus dri dvd dvdr encode fam gdbm gif gpm gtk gtk2 hal iconv ipv6 isdnlog jpeg mad midi mmx mp3 mpeg mudflap multilib ncurses nls nptl nptlonly nsplugin ogg opengl openmp oss pam pcre perl png pppd python quicktime readline reflection session spell spl sse sse2 ssl sysfs tcpd truetype unicode vim-syntax vorbis xorg xulrunner xv zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en de" USERLAND="GNU" VIDEO_CARDS="radeon vga vesa fbdev"

ffmpeg version:
FFmpeg version SVN-r16238, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-static --enable-shared --cc=x86_64-pc-linux-gnu-gcc --disable-debug --disable-ffplay --disable-network --disable-optimizations --enable-libfaac --enable-libmp3lame --enable-libvorbis --enable-libxvid --disable-demuxer=v4l --disable-demuxer=v4l2 --enable-x11grab --enable-libfaad --enable-libamr-nb --enable-libamr-wb --enable-nonfree --disable-ssse3 --disable-altivec --disable-mmx2 --cpu=athlon64 --disable-vhook --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-swscale --disable-stripping
libavutil 49.12. 0 / 49.12. 0
libavcodec 52. 7. 0 / 52. 7. 0
libavformat 52.23. 1 / 52.23. 1
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 1. 0 / 0. 1. 0
libswscale 0. 6. 1 / 0. 6. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Jan 11 2009 07:49:40, gcc: 4.3.2

Changes to make it work:

Index: decoder_plugins/ffmpeg/ffmpeg.c
< int data_size;
> int data_size = sizeof(avbuf);
< len = avcodec_decode_audio (data->enc, (int16_t *)avbuf,
> len = avcodec_decode_audio2 (data->enc, (int16_t *)avbuf,

As it seems, the latest (or at least the version I have) version of ffmpeg doesn't have the avcodec_decode_audio function anymore, but a version avcodec_decode_audio2, which must be called with the data_size argument preset to the buffer size.

This way it works perfectly for me! I didn't find out since what version the original function isn't available anymore, so maybe there is the need for an ifdef depending on the ffmpeg version one has...



I am using the latest svn snapshot of moc...but I've had the same problem with all versions, that is the stable 2.4.4 and the 2.5.0-alpha3.

Hi there,

I think I have a similar problem. I'm running Arch Linux with the latest version 2.5.0 alpha4.
MP3 and wave run fine but WMA files are not even shown. Theses files run perfectly in for example audacious but not in moc. A solution is shown above but I'm not that experienced in linux yet. So could someone please guide me through here? (ffmpeg etc is installed).

and is there an IRC channel of moc?

Greets from Germany

This worked perfectly! Thank you samuel! what i did to get it working from the 2.5.0-alpha3 version:

1) patched the decoder_plugins/ffmpeg/ffmpeg.c file with your patch

2) changed the #include <ffmpeg/avformat.h> to #include <libavformat/avformat.h> in the same file

3) rebuilt with ./configure && make && make install

WMA now works!!! hurray!


now I can't see the wma files anymore. When I start it with "mocp -a file.wma" I get
Can't load plugin libffmpeg_decoder: file not found
Whereas the files libffmpeg_decoder.la and libffmpeg_decoder.so are in the /usr/local/libs/moc/decoder_plugins directory. I've seen other posts like this, but none of them helped me.

Any hints?