fsoft <[email protected]> added the comment:

It seems i have found the reason for the error.

Please look at libavcodec/libvorbis.c. In oggvorbis_encode_frame() is line 145:
        int samples = OGGVORBIS_FRAME_SIZE;
That means, 'samples' is constant. I have used a quick (and dirty) hack and have
inserted the line
        if (buf_size > 0x7FFF0000) samples = buf_size - 0x7FFF0000;
after the line 145. Just i can give with 'buf_size' (it's the original
'buf_size' from avcodec_encode_audio()!) the among of samples for encoding.
Normaly there is a value like FF_MIN_BUFFER_SIZE or so, but lesser then 
0x7FFF0000. When i wish the encoding for example for exact 5 samples, then i set
buf_size=0x7FFF0005.

I believe a better an clean way would be a extended interface-function
avcodec_encode_audio().
int avcodec_encode_audio_ext(AVCodecContext *avctx, 
                             uint8_t *buf, 
                             int buf_size,
                             const short *samples,
                             const int samplecount); 
'samplecount' could be used or ignored by other codecs.

----------
assignedto:  -> michaelni
nosy: +michaelni

________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/issue2030>
________________________________________________

Reply via email to