同梱ffmpegのlameエンコードの不具合 †このページは一時的なものです †このページは一利用者が Craving Explorer 内蔵の ffmpeg について作者さんへ提案をするために一時的に作成したものです。 同梱ffmpegのlameエンコードの不具合 †現行の ffmpeg に lame 3.98-2 をリンクして -acodec libmp3lame で音声をエンコードすると
という状況になります。 とりあえず応急処置的に以下の修正を libavcodec/libmp3lame.c に加えたところ問題が出なくなったようなので、 Index: libavcodec/libmp3lame.c =================================================================== --- libavcodec/libmp3lame.c (リビジョン 16716) +++ libavcodec/libmp3lame.c (作業コピー) @@ -34,6 +34,7 @@ int stereo; uint8_t buffer[BUFFER_SIZE]; int buffer_index; + int buffer_flushed; } Mp3AudioContext; static av_cold int MP3lame_encode_init(AVCodecContext *avctx) @@ -73,6 +74,8 @@ avctx->coded_frame= avcodec_alloc_frame(); avctx->coded_frame->key_frame= 1; + s->buffer_flushed = 0; + return 0; err_close: @@ -166,13 +169,15 @@ BUFFER_SIZE - s->buffer_index ); } - }else{ + }else if(data == NULL && s->buffer_flushed == 0){ lame_result= lame_encode_flush( s->gfp, s->buffer + s->buffer_index, BUFFER_SIZE - s->buffer_index ); - } + s->buffer_flushed = 1; + }else + lame_result = 0; if(lame_result < 0){ if(lame_result==-1) { よろしくお願いします。 以下はコメント欄
|