changeset 21773:03bc990498fc

the avi spec does not allow random samplesize whoever wrote this should be shot also block align should be equal to sample size i dunno if this breaks anything but the old code was definitly not correct this also fixes amr_nb muxing (in .3gp with lavf for example)
author michael
date Fri, 29 Dec 2006 20:40:19 +0000
parents 8bc0464ab286
children 3de9ef5678e7
files libmpcodecs/ae_lavc.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ae_lavc.c	Fri Dec 29 19:01:55 2006 +0000
+++ b/libmpcodecs/ae_lavc.c	Fri Dec 29 20:40:19 2006 +0000
@@ -56,9 +56,12 @@
 			mux_a->h.dwSampleSize = 0; // Blocksize not constant
 		} 
 		else 
-			mux_a->h.dwSampleSize = mux_a->h.dwScale;
+			mux_a->h.dwSampleSize = 0;
 	}
-	mux_a->wf->nBlockAlign = mux_a->h.dwScale;
+        if(mux_a->h.dwSampleSize)
+                mux_a->wf->nBlockAlign = mux_a->h.dwSampleSize;
+        else
+                mux_a->wf->nBlockAlign = 1;
 	mux_a->h.dwSuggestedBufferSize = (encoder->params.audio_preload*mux_a->wf->nAvgBytesPerSec)/1000;
 	mux_a->h.dwSuggestedBufferSize -= mux_a->h.dwSuggestedBufferSize % mux_a->wf->nBlockAlign;