Michael Niedermayer <[email protected]> added the comment:
On Fri, Jun 19, 2009 at 09:19:39AM +0000, Yoshihisa Uchida wrote:
[...]
> 2 files changed, 3 insertions(+), 1 deletion(-)
> 4094fc97ab5d571d9d7d903a421f918a31cf0881 ffmpeg_swf_adpcm.patch
> diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> old mode 100644
> new mode 100755
> index 8184378..494f017
> --- a/libavcodec/adpcm.c
> +++ b/libavcodec/adpcm.c
> @@ -188,6 +188,8 @@ static av_cold int adpcm_encode_init(AVCodecContext
> *avctx)
> return -1;
> }
> avctx->frame_size = 512 * (avctx->sample_rate / 11025);
> + /* bitsPerSample is 4. (other values (2, 3, 5) do not support.) */
> + avctx->block_align = (7 + 2 + (22 + (avctx->frame_size - 1) * 4) *
> avctx->channels) >> 3;
> break;
> default:
> return -1;
hunk ok given its tested
> diff --git a/libavformat/riff.c b/libavformat/riff.c
> old mode 100644
> new mode 100755
> index fbd40d4..3cc7724
> --- a/libavformat/riff.c
> +++ b/libavformat/riff.c
> @@ -313,7 +313,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
> put_le32(pb, enc->sample_rate);
> if (enc->codec_id == CODEC_ID_MP2 || enc->codec_id == CODEC_ID_MP3 ||
> enc->codec_id == CODEC_ID_GSM_MS) {
> bps = 0;
> - } else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV || enc->codec_id ==
> CODEC_ID_ADPCM_MS || enc->codec_id == CODEC_ID_ADPCM_G726 || enc->codec_id ==
> CODEC_ID_ADPCM_YAMAHA) { //
> + } else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV || enc->codec_id ==
> CODEC_ID_ADPCM_MS || enc->codec_id == CODEC_ID_ADPCM_G726 || enc->codec_id ==
> CODEC_ID_ADPCM_YAMAHA || enc->codec_id == CODEC_ID_ADPCM_SWF) { //
> bps = 4;
> } else {
> if (!(bps = av_get_bits_per_sample(enc->codec_id)))
cant av_get_bits_per_sample() return the correct value?
_____________________________________________________
FFmpeg issue tracker <[email protected]>
<https://roundup.ffmpeg.org/roundup/ffmpeg/issue1205>
_____________________________________________________