changeset 5370:bb1d63fea638

ac3_iec958_build_burst moved from ac3-iec958.c
author arpi
date Wed, 27 Mar 2002 21:05:39 +0000
parents 2d678eeb3d42
children 81f22cd2c212
files libmpcodecs/ad_hwac3.c
diffstat 1 files changed, 22 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_hwac3.c	Wed Mar 27 12:12:24 2002 +0000
+++ b/libmpcodecs/ad_hwac3.c	Wed Mar 27 21:05:39 2002 +0000
@@ -1,5 +1,9 @@
+
+// Reference: DOCS/tech/hwac3.txt !!!!!
+
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "config.h"
@@ -9,7 +13,6 @@
 #include "ad_internal.h"
 
 #include "../liba52/a52.h"
-#include "../ac3-iec958.h"
 
 extern int a52_fillbuff(sh_audio_t *sh_audio);
 
@@ -81,8 +84,23 @@
 {
   int len=-1;
   if(!sh_audio->a_in_buffer_len)
-    if((len=a52_fillbuff(sh_audio))<0) return len; /*EOF*/
+    if((len=a52_fillbuff(sh_audio))<=0) return len; /*EOF*/
   sh_audio->a_in_buffer_len=0;
-  len = ac3_iec958_build_burst(len, 0x01, 1, sh_audio->a_in_buffer, buf);
-  return len;
+
+//    int ac3_iec958_build_burst(int length, int data_type, int big_endian, unsigned char * data, unsigned char * out)
+//  len = ac3_iec958_build_burst(len, 0x01, 1, sh_audio->a_in_buffer, buf);
+
+	buf[0] = 0x72;
+	buf[1] = 0xF8;
+	buf[2] = 0x1F;
+	buf[3] = 0x4E;
+	buf[4] = 0x01; //(length) ? data_type : 0; /* & 0x1F; */
+	buf[5] = 0x00;
+	buf[6] = (len << 3) & 0xFF;
+	buf[7] = (len >> 5) & 0xFF;
+	swab(sh_audio->a_in_buffer, buf + 8, len);
+	//memcpy(buf + 8, sh_audio->a_in_buffer, len);
+	memset(buf + 8 + len, 0, 6144 - 8 - len);
+
+	return 6144;
 }