Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 26940 | Differences between
and this patch

Collapse All | Expand All

(-)avilib/avilib.c (-6 / +20 lines)
Lines 869-885 Link Here
869
     
869
     
870
     //if (AVI->track[j].a_chans && AVI->track[j].audio_bytes)
870
     //if (AVI->track[j].a_chans && AVI->track[j].audio_bytes)
871
       {
871
       {
872
	 unsigned long nBlockAlign;
872
	 unsigned long nBlockAlign = 0;
873
	 unsigned long avgbsec = 0;
874
	 unsigned long scalerate = 0;
873
	   
875
	   
874
	 sampsize = avi_sampsize(AVI, j);
876
	 sampsize = avi_sampsize(AVI, j);
875
	 sampsize = AVI->track[j].a_fmt==0x1?sampsize*4:sampsize;
877
	 sampsize = AVI->track[j].a_fmt==0x1?sampsize*4:sampsize;
876
878
877
	 nBlockAlign = (AVI->track[j].a_rate<32000)?576:1152;
879
	 nBlockAlign = (AVI->track[j].a_rate<32000)?576:1152;
878
	 /*
880
	 /*
879
	 printf("XXX sampsize (%d) block (%ld) rate (%ld) audio_bytes (%ld) chunks(%ld)\n", 
881
	 printf("XXX sampsize (%d) block (%ld) rate (%ld) audio_bytes (%ld) mp3rate(%ld,%ld)\n", 
880
		 sampsize, nBlockAlign, AVI->track[j].a_rate, AVI->track[j].audio_bytes, AVI->track[j].audio_chunks );
882
		 sampsize, nBlockAlign, AVI->track[j].a_rate, 
883
		 (long int)AVI->track[j].audio_bytes, 
884
		 1000*AVI->track[j].mp3rate/8, AVI->track[j].mp3rate);
881
		 */
885
		 */
882
	   
886
	   
887
	 if (AVI->track[j].a_fmt==0x1) {
888
	     sampsize = (AVI->track[j].a_chans<2)?sampsize/2:sampsize;
889
	     avgbsec = AVI->track[j].a_rate*sampsize/4;
890
	     scalerate = AVI->track[j].a_rate*sampsize/4;
891
	 } else  {
892
	     avgbsec = 1000*AVI->track[j].mp3rate/8;
893
	     scalerate = 1000*AVI->track[j].mp3rate/8;
894
	 }
895
883
	 OUT4CC ("LIST");
896
	 OUT4CC ("LIST");
884
	 OUTLONG(0);        /* Length of list in bytes, don't know yet */
897
	 OUTLONG(0);        /* Length of list in bytes, don't know yet */
885
	 strl_start = nhb;  /* Store start position */
898
	 strl_start = nhb;  /* Store start position */
Lines 913-919 Link Here
913
	     OUTLONG(0);                             /* Frame */
926
	     OUTLONG(0);                             /* Frame */
914
	 } else {
927
	 } else {
915
	     OUTLONG(sampsize/4);                    /* Scale */
928
	     OUTLONG(sampsize/4);                    /* Scale */
916
	     OUTLONG(1000*AVI->track[j].mp3rate/8);  /* Rate */
929
	     OUTLONG(scalerate);  /* Rate */
917
	     OUTLONG(0);                             /* Start */
930
	     OUTLONG(0);                             /* Start */
918
	     OUTLONG(4*AVI->track[j].audio_bytes/sampsize);   /* Length */
931
	     OUTLONG(4*AVI->track[j].audio_bytes/sampsize);   /* Length */
919
	     OUTLONG(0);                             /* SuggestedBufferSize */
932
	     OUTLONG(0);                             /* SuggestedBufferSize */
Lines 965-978 Link Here
965
	 
978
	 
966
	 } else {
979
	 } else {
967
980
968
	     OUTLONG(16);                   /* # of bytes to follow */
981
	     OUTLONG(18);                   /* # of bytes to follow */
969
	     OUTSHRT(AVI->track[j].a_fmt);           /* Format */
982
	     OUTSHRT(AVI->track[j].a_fmt);           /* Format */
970
	     OUTSHRT(AVI->track[j].a_chans);         /* Number of channels */
983
	     OUTSHRT(AVI->track[j].a_chans);         /* Number of channels */
971
	     OUTLONG(AVI->track[j].a_rate);          /* SamplesPerSec */
984
	     OUTLONG(AVI->track[j].a_rate);          /* SamplesPerSec */
972
	     //ThOe/tibit
985
	     //ThOe/tibit
973
	     OUTLONG(1000*AVI->track[j].mp3rate/8);
986
	     OUTLONG(avgbsec);  /* Avg bytes/sec */
974
	     OUTSHRT(sampsize/4);                    /* BlockAlign */
987
	     OUTSHRT(sampsize/4);                    /* BlockAlign */
975
	     OUTSHRT(AVI->track[j].a_bits);          /* BitsPerSample */
988
	     OUTSHRT(AVI->track[j].a_bits);          /* BitsPerSample */
989
	     OUTSHRT(0);                           /* cbSize */  
976
990
977
	 }
991
	 }
978
	 /* Finish stream list, i.e. put number of bytes in the list to proper pos */
992
	 /* Finish stream list, i.e. put number of bytes in the list to proper pos */

Return to bug 26940