changeset 3910:45dfe99dced8 libavformat

set block align in av_write_header if not set, fix issue #489
author bcoudurier
date Mon, 08 Sep 2008 19:37:22 +0000
parents 214c1c37be6f
children 308606d12c24
files utils.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Mon Sep 08 19:11:53 2008 +0000
+++ b/utils.c	Mon Sep 08 19:37:22 2008 +0000
@@ -2444,6 +2444,9 @@
                 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?