[FFmpeg-cvslog] Float output for libavcodec Vorbis decoder

clsid2 git at videolan.org
Sun Apr 3 22:54:42 CEST 2011


ffmpeg | branch: master | clsid2 <clsid2 at 3b938f2f-1a1a-0410-8054-a526ea5ff92c> | Mon Mar  7 00:46:59 2011 +0000| [ba7a28045f0de749f5e84fbefeb626da9952226c] | committer: Michael Niedermayer

Float output for libavcodec Vorbis decoder

git-svn-id: https://ffdshow-tryout.svn.sourceforge.net/svnroot/ffdshow-tryout@3771 3b938f2f-1a1a-0410-8054-a526ea5ff92c

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

 libavcodec/vorbis_dec.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c
index 637f510..5ed3631 100644
--- a/libavcodec/vorbis_dec.c
+++ b/libavcodec/vorbis_dec.c
@@ -1007,7 +1007,12 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext)
     avccontext->channels    = vc->audio_channels;
     avccontext->sample_rate = vc->audio_samplerate;
     avccontext->frame_size  = FFMIN(vc->blocksize[0], vc->blocksize[1]) >> 2;
+    /* ffdshow custom code */
+#if CONFIG_AUDIO_FLOAT
+    avccontext->sample_fmt  = AV_SAMPLE_FMT_FLT;
+#else
     avccontext->sample_fmt  = AV_SAMPLE_FMT_S16;
+#endif
 
     return 0 ;
 }
@@ -1635,9 +1640,15 @@ static int vorbis_decode_frame(AVCodecContext *avccontext,
                               len * ff_vorbis_channel_layout_offsets[vc->audio_channels - 1][i];
     }
 
+    /* ffdshow custom code */
+#if CONFIG_AUDIO_FLOAT
+    float_interleave(data, channel_ptrs, len, vc->audio_channels);
+    *data_size = len * sizeof(float) * vc->audio_channels;
+#else
     vc->fmt_conv.float_to_int16_interleave(data, channel_ptrs, len,
                                            vc->audio_channels);
     *data_size = len * 2 * vc->audio_channels;
+#endif
 
     return buf_size ;
 }



More information about the ffmpeg-cvslog mailing list