Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- base/MaiFile.cc.old 2012-12-04 02:21:28.000000000 +0100
- +++ base/MaiFile.cc 2013-09-10 19:22:42.269820093 +0200
- @@ -341,8 +341,7 @@
- Mai_I64 fpn;
- fpn = this->getFilePointer();
- - //if (!::ftruncate64(file0, newLength))
- - if (!::syscall(__NR_ftruncate64, file0, newLength))
- + if (!::ftruncate64(file0, newLength))
- {
- this->seek(fpn);
- return 0;
- --- Makefile.old 2013-09-10 19:46:48.000000000 +0200
- +++ Makefile 2013-09-10 19:54:37.013141496 +0200
- @@ -1,6 +1,6 @@
- outdir=../output
- -target=$(outdir)/libMaiAT3PlusDecoder.a
- +target=$(outdir)/libat3plusdecoder.so
- objs=$(outdir)/Heap_Alloc0.o\
- $(outdir)/MaiFile.o\
- @@ -18,22 +18,22 @@
- $(outdir)/MaiAT3PlusCoreDecoder_StaticData.o\
- $(outdir)/MaiAT3PlusCoreDecoder_SubFunc.o\
- $(outdir)/MaiAT3PlusFrameDecoder.o\
- + $(outdir)/cframedecoder.o\
- - $(outdir)/MaiBitReader.o\
- - $(outdir)/MaiBitReader.o\
- hs=
- -Mai_CXX_O=g++ -O2 -c "-I../include" -fno-exceptions -fno-rtti
- +Mai_CXX_O=g++ -O2 -c "-I../include" -fno-exceptions -fno-rtti -fPIC
- Mai_RM_O=rm -f
- Mai_AR_O=ar -rcv
- +Mai_SO_O=g++ -shared -o
- all : $(target)
- $(target) : $(objs)
- $(Mai_RM_O) $(target)
- - $(Mai_AR_O) $(target) $(objs)
- + $(Mai_SO_O) $(target) $(objs)
- $(objs) : $(hs)
- $(outdir)/%.o : %.cpp
- u /dev/null cinterface.cpp
- --- /dev/null 2013-09-10 18:17:46.643177700 +0200
- +++ cframedecoder.cpp 2013-09-10 20:54:12.993119214 +0200
- @@ -0,0 +1,41 @@
- +/*
- + * MaiAT3PlusCoreDecoder
- + * Copyright (c) 2013 ryuukazenomai <ryuukazenomai@foxmail.com>
- + *
- + * This file is part of MaiAT3PlusDecoder.
- + *
- + * MaiAT3PlusDecoder is free software; you can redistribute it and/or
- + * modify it under the terms of the GNU Lesser General Public
- + * License as published by the Free Software Foundation; either
- + * version 2.1 of the License, or (at your option) any later version.
- + *
- + * MaiAT3PlusDecoder is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- + * Lesser General Public License for more details.
- + *
- + * You should have received a copy of the GNU Lesser General Public
- + * License along with MaiAT3PlusDecoder; if not, write to the Free Software
- + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- + */
- +#include "MaiAT3PlusFrameDecoder.h"
- +
- +extern "C" void* Atrac3plusDecoder_openContext()
- +{
- + return new MaiAT3PlusFrameDecoder;
- +}
- +
- +extern "C" int Atrac3plusDecoder_closeContext(void* context)
- +{
- + MaiAT3PlusFrameDecoder *frame_decoder =(MaiAT3PlusFrameDecoder*)context;
- + if (frame_decoder)
- + delete frame_decoder;
- + return 0;
- +}
- +
- +extern "C" int Atrac3plusDecoder_decodeFrame(void* context, void* inbuf, int inbytes, int* channels, void** outbuf)
- +{
- + MaiAT3PlusFrameDecoder *frame_decoder = (MaiAT3PlusFrameDecoder*)context;
- + return frame_decoder->decodeFrame((Mai_I8*)inbuf, inbytes, channels, (Mai_I16**)outbuf);
- +}
- +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement