diff options
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | audiorecorder.c | 2 | ||||
-rw-r--r-- | convert.c | 15 |
3 files changed, 22 insertions, 5 deletions
@@ -37,6 +37,16 @@ APIVERSION = $(call PKGCFG,apiversion) ### Allow user defined options to overwrite defaults: +## start new avcodec +## this is only used for plugin developer!!! +## convert deprecated audio function in convert.c +## avcodec_decode_audio3 --> avcodec_decode_audio4 +## avcodec_encode_audio --> avcodec_encode_audio2 + +#AVCODEC_NEW = 1 + +## end new avcodec + -include $(PLGCFG) ### The name of the distribution archive: diff --git a/audiorecorder.c b/audiorecorder.c index 0bcf686..41d2c90 100644 --- a/audiorecorder.c +++ b/audiorecorder.c @@ -35,7 +35,7 @@ using namespace std; /* --- cPluginAudiorecorder ------------------------------------------------- */ const char *cPluginAudiorecorder::DESCRIPTION = tr("floods your disc with music"); -const char *cPluginAudiorecorder::VERSION = "2.0.0_rc5"; +const char *cPluginAudiorecorder::VERSION = "2.0.0_rc6"; string cPluginAudiorecorder::recdir; int cPluginAudiorecorder::debug = 0; @@ -73,8 +73,6 @@ void cConvert::init_decoder(void) void cConvert::init_encoder(const char *codec, int bit_rate, int sample_rate, int channels) { - // avcodec_register_all(); // wird das hier wirklich gebraucht? still initialized in audiorecorder.c - encoder_codec = avcodec_find_encoder_by_name(codec); if (! encoder_codec) { dsyslog("[audiorecorder]: codec %s is not supported (%s, " @@ -114,7 +112,7 @@ void cConvert::decode_mpa_frame(mpeg_audio_frame *mpa_frame) return; } -// ToDo: convert to use avcodec_decode_audio4 +#ifndef AUDIOCODEC_NEW AVPacket avpkt; av_init_packet(&avpkt); avpkt.data = mpa_frame->data; @@ -122,6 +120,11 @@ void cConvert::decode_mpa_frame(mpeg_audio_frame *mpa_frame) decoder_buf.length = AVCODEC_MAX_AUDIO_FRAME_SIZE; int len = avcodec_decode_audio3(decoder_ctx, (short *)decoder_buf.data, &decoder_buf.length, &avpkt); +#else +#error "avcodec_decode_audio4 not implemented yet!" +// ToDo + +#endif } @@ -153,10 +156,14 @@ abuffer *cConvert::reencode_mpa_frame(mpeg_audio_frame *mpa_frame, } } -// ToDo: avcodec_encode_audio is deprecated,.. +#ifndef AUDICODEC_NEW encoder_buf.offset = avcodec_encode_audio(encoder_ctx, encoder_buf.data, encoder_buf.length, (short *)decoder_buf.data); /* encoder_buf.offset is used to save the size of the encoded frame */ +#else +#error "avcodec_encode_audio2 not imlemented yet!" +// ToDo +#endif return &encoder_buf; } |