Commit 01901469 authored by bcoudurier's avatar bcoudurier

set block align in av_write_header if not set, fix issue #489

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15277 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent bfcb6c87
...@@ -2444,6 +2444,9 @@ int av_write_header(AVFormatContext *s) ...@@ -2444,6 +2444,9 @@ int av_write_header(AVFormatContext *s)
av_log(s, AV_LOG_ERROR, "sample rate not set\n"); av_log(s, AV_LOG_ERROR, "sample rate not set\n");
return -1; 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; break;
case CODEC_TYPE_VIDEO: case CODEC_TYPE_VIDEO:
if(st->codec->time_base.num<=0 || st->codec->time_base.den<=0){ //FIXME audio too? if(st->codec->time_base.num<=0 || st->codec->time_base.den<=0){ //FIXME audio too?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment