diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-09-08 19:37:22 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-09-08 19:37:22 +0000 |
commit | bf912a482b01ce0c0b5396bf5ce92fc891fd7d73 (patch) | |
tree | 8d5381509218ed8e16b1dbd9844d44e8807f537a | |
parent | bed4fc54c947b9e36d2103b400d438bfb4dd80dd (diff) | |
download | ffmpeg-bf912a482b01ce0c0b5396bf5ce92fc891fd7d73.tar.gz |
set block align in av_write_header if not set, fix issue #489
Originally committed as revision 15277 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index e82324f323..c124507446 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2444,6 +2444,9 @@ int av_write_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "sample rate not set\n"); return -1; } + if(!st->codec->block_align) + st->codec->block_align = st->codec->channels * + av_get_bits_per_sample(st->codec->codec_id) >> 3; break; case CODEC_TYPE_VIDEO: if(st->codec->time_base.num<=0 || st->codec->time_base.den<=0){ //FIXME audio too? |