[FFmpeg-cvslog] Support for shine 3.0.0

Romain Beauxis git at videolan.org
Tue Jul 30 23:13:27 CEST 2013


ffmpeg | branch: master | Romain Beauxis <toots at rastageeks.org> | Sun Jul 21 15:40:08 2013 -0500| [38536e59275052b89755c6ee806642ce27055009] | committer: Paul B Mahol

Support for shine 3.0.0

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=38536e59275052b89755c6ee806642ce27055009
---

 configure             |    2 +-
 libavcodec/libshine.c |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/configure b/configure
index a341d87..e215a2a 100755
--- a/configure
+++ b/configure
@@ -4169,7 +4169,7 @@ enabled libpulse          && require_pkg_config libpulse-simple pulse/simple.h p
 enabled libquvi           && require_pkg_config libquvi quvi/quvi.h quvi_init
 enabled librtmp           && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
 enabled libschroedinger   && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
-enabled libshine          && require_pkg_config shine shine/layer3.h shine_encode_frame
+enabled libshine          && require_pkg_config shine shine/layer3.h shine_encode_buffer
 enabled libsoxr           && require libsoxr soxr.h soxr_create -lsoxr
 enabled libspeex          && require libspeex speex/speex.h speex_decoder_init -lspeex
 enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c
index 521ac17..cf8b1bb 100644
--- a/libavcodec/libshine.c
+++ b/libavcodec/libshine.c
@@ -50,17 +50,17 @@ static av_cold int libshine_encode_init(AVCodecContext *avctx)
     shine_set_config_mpeg_defaults(&s->config.mpeg);
     if (avctx->bit_rate)
         s->config.mpeg.bitr = avctx->bit_rate / 1000;
-    if (shine_find_bitrate_index(s->config.mpeg.bitr) < 0) {
-        av_log(avctx, AV_LOG_ERROR, "invalid bitrate\n");
-        return AVERROR(EINVAL);
-    }
     s->config.mpeg.mode = avctx->channels == 2 ? STEREO : MONO;
     s->config.wave.samplerate = avctx->sample_rate;
     s->config.wave.channels   = avctx->channels == 2 ? PCM_STEREO : PCM_MONO;
+    if (shine_check_config(s->config.wave.samplerate, s->config.mpeg.bitr) < 0) {
+        av_log(avctx, AV_LOG_ERROR, "invalid configuration\n");
+        return AVERROR(EINVAL);
+    }
     s->shine = shine_initialise(&s->config);
     if (!s->shine)
         return AVERROR(ENOMEM);
-    avctx->frame_size = samp_per_frame;
+    avctx->frame_size = shine_samples_per_pass(s->shine);
     ff_af_queue_init(avctx, &s->afq);
     return 0;
 }
@@ -75,7 +75,7 @@ static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     int ret, len;
 
     if (frame)
-        data = shine_encode_frame(s->shine, frame->data[0], &written);
+        data = shine_encode_buffer(s->shine, (int16_t **)frame->data, &written);
     else
         data = shine_flush(s->shine, &written);
     if (written < 0)



More information about the ffmpeg-cvslog mailing list