changeset 6225:b8a6ed04da91 libavformat

Rename block_align variable in the avi demuxer to clearly seperate its purpose from the true block_align.
author michael
date Fri, 02 Jul 2010 23:33:10 +0000
parents 4c7c979b1f5a
children 7b81ef3e7d99
files avidec.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/avidec.c	Fri Jul 02 17:39:03 2010 +0000
+++ b/avidec.c	Fri Jul 02 23:33:10 2010 +0000
@@ -48,7 +48,7 @@
     int prefix_count;
     uint32_t pal[256];
     int has_pal;
-    int block_align;                  ///< AVCodecContext.block_align copied here for easier access
+    int dshow_block_align;            ///< block align variable used to emulate bugs in the MS dshow demuxer
 } AVIStream;
 
 typedef struct {
@@ -93,8 +93,8 @@
 static inline int get_duration(AVIStream *ast, int len){
     if(ast->sample_size){
         return len;
-    }else if (ast->block_align){
-        return (len + ast->block_align - 1)/ast->block_align;
+    }else if (ast->dshow_block_align){
+        return (len + ast->dshow_block_align - 1)/ast->dshow_block_align;
     }else
         return 1;
 }
@@ -572,7 +572,7 @@
                     break;
                 case AVMEDIA_TYPE_AUDIO:
                     ff_get_wav_header(pb, st->codec, size);
-                    ast->block_align= st->codec->block_align;
+                    ast->dshow_block_align= st->codec->block_align;
                     if(ast->sample_size && st->codec->block_align && ast->sample_size != st->codec->block_align){
                         av_log(s, AV_LOG_WARNING, "sample size (%d) != block align (%d)\n", ast->sample_size, st->codec->block_align);
                         ast->sample_size= st->codec->block_align;