关于我
 

xjpvictor's Blog
小老鼠,上灯台,两只耳朵竖起来

moc-ape


各种折腾·archlinuxlinuxscript

本文最后编辑于超过3716天以前,部分内容可能已经失效

moc不支持ape,但是通过patch可以支持。
原帖是moc论坛的Planner发的,http://moc.daper.net/node/110。同时使用了archlinux官方的patch,支持wma,见http://repos.archlinux.org/wsvn/packages/moc/repos/extra-i686/。最终的patch如下

diff -Naur moc-2.4.4/decoder_plugins/ffmpeg/ffmpeg.c moc-2.4.4-new/decoder_plugins/ffmpeg/ffmpeg.c
--- moc-1.4.4/decoder_plugins/ffmpeg/ffmpeg.c 2008-04-09 14:44:00.000000000 -0400
+++ moc-2.4.4-new/decoder_plugins/ffmpeg/ffmpeg.c 2009-03-07 01:31:48.000000000 -0500
@@ -222,8 +222,8 @@
{
struct ffmpeg_data *data = (struct ffmpeg_data *)prv_data;
int ret;
- int data_size;
char avbuf[AVCODEC_MAX_AUDIO_FRAME_SIZE * sizeof(int16_t)];
+ int data_size = sizeof(avbuf);
AVPacket pkt;
uint8_t *pkt_data;
int pkt_size = 0;
@@ -270,7 +270,7 @@
while (pkt_size) {
int len;

- len = avcodec_decode_audio (data->enc, (int16_t *)avbuf,
+ len = avcodec_decode_audio2 (data->enc, (int16_t *)avbuf,
&data_size, pkt_data, pkt_size);
debug ("Decoded %dB", data_size);

@@ -345,6 +345,8 @@
strcpy (buf, "MP4");
else if (!strcasecmp(ext, "m4a"))
strcpy (buf, "M4A");
+ else if (!strcasecmp(ext, "ape"))
+ strcpy (buf, "APE");
}

static int ffmpeg_our_format_ext (const char *ext)
@@ -353,7 +355,8 @@
|| !strcasecmp(ext, "ra")
|| !strcasecmp(ext, "m4a")
|| !strcasecmp(ext, "mp4")
- || !strcasecmp(ext, "aac");
+ || !strcasecmp(ext, "aac")
+ || !strcasecmp(ext, "ape");
}

static void ffmpeg_get_error (void *prv_data, struct decoder_error *error)

同时也做了一个arch的pkgbuild,基本上只是改了官方的

pkgname=moc-ape
pkgver=2.4.4
pkgrel=3
pkgdesc="An ncurses console audio player with support for the mp3, ogg, and wave formats"
arch=('i686' 'x86_64')
url="http://moc.daper.net/"
license=('GPL')
depends=('libmad' 'libid3tag' 'jack-audio-connection-kit' 'curl>=7.16.2' 'libsamplerate' 'libtool')
makedepends=('speex' 'ffmpeg' 'taglib' 'libmpcdec')
conflicts=('moc' 'moc-svn')
optdepends=('speex: for using the speex plugin' 'ffmpeg: for using the ffmpeg plugin' 'taglib and libmpcdec: for using the musepack plugin')
options=('!libtool')
source=(ftp://ftp.daper.net/pub/soft/moc/stable/moc-${pkgver}.tar.bz2 moc-2.4.4-ffmpeg.diff)
md5sums=('647c770a5542a4ae5437386807a89796' '631218fcf8285fdd63a2530af28f8659')

build() {
cd ${srcdir}/moc-${pkgver}
patch -p1 < ../moc-2.4.4-ffmpeg.diff || return 1
sed -i 's|ffmpeg/avformat.h|libavformat/avformat.h|' decoder_plugins/ffmpeg/ffmpeg.c || return 1
./configure --prefix=/usr --without-rcc || return 1
make || return 1
make DESTDIR=${pkgdir} install || return 1
}

但是放到aur中的有地方写错了,但是又不让我修改,所以等有新版的时候估计就能改了,那时候版本号变了就好了。

Update: 2012-03-22
我已经没有在用moc,而moc也两年多没更新。aur上的包我orphan了,这个patch也不知道还有没有用。

本文 "moc-ape" 由 K. Huang 首先发表于 xjpvictor's Blog 并以 CC BY-NC 4.0 许可证发布 © 2009
转载注明引用来源 https://blog.xjpvictor.info/2009/10/moc-ape/


推广:本博客使用 Linode VPS,口碑好,信誉佳,快速稳定,性价比高

打赏我

评论

你的邮箱地址不会被公开。必填项以 * 标出

无意义或不相关评论将被删除

允许使用以下html标签:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

你可以上传文件,粘贴代码或长文至 Drop.it.r

本博客是言论不自由博客,评论只接受询问及赞同,不同观点请出门左转微博/发表于自己的博客。谢谢合作!

评论意味着你 同意 上传部分私人数据,包括邮箱和 IP, 这些数据不会被分享给第三方,不会用于商业用途或再推广用途。

更多相似文章