Problem addressed by this patch:
There are two related problems in transform.c preventing DVB AC3 audio from
working:
1. The private stream header length was not being set, resulting in mpeg.c not
extracting the AC3 payload correctly.
2. There is a call to "get_ac3info" which was not always succeeding, I believe
because only part of the ac3 payload was being searched. This resulted in the
4 byte ac3 header not being reliably added to the mpeg stream.
The fix:
1. Set the header length as needed.
2. Put a place holder 4 byte header into the stream and then rely on the code
in send_ipack to put the correct values into the header.
This patched should be reviewed by Marcus to be sure he agrees with the
changes.
Regards,
Mark Anderson
--- ../mythtv.orig/libs/libmythtv/dvbdev/transform.c 2005-01-24 09:45:30.000000000 +1100
+++ libs/libmythtv/dvbdev/transform.c 2005-01-26 07:58:33.000000000 +1100
@@ -426,6 +426,7 @@ void send_ipack(ipack *p)
if (p->cid == PRIVATE_STREAM1){
switch (streamid & 0xF8){
case 0x80:
+ p->buf[8] = p->hlength;
p->count += 4;
p->buf[9] = streamid;
p->buf[10] = 0;
@@ -473,18 +474,17 @@ static void write_ipack(ipack *p, uint8_
case PRIV_TS_AC3: /* keep this as default */
default:
{
- int ac3_off;
- ac3_off = get_ac3info(data, count, &ai,0);
- if (ac3_off>=0 && ai.framesize){
+ /*
+ * add in a dummy 4 byte audio header
+ * to match mpeg dvd standard. The values
+ * will be filled in later (in send_ipack)
+ * when it has a full packet to search
+ */
p->buf[p->count] = 0x80;
- p->buf[p->count+1] = (p->size - p->count
- - 4 - ac3_off)/
- ai.framesize + 1;
- p->buf[p->count+2] = (ac3_off >> 8)& 0xFF;
- p->buf[p->count+3] = (ac3_off)& 0xFF;
+ p->buf[p->count+1] = 0;
+ p->buf[p->count+2] = 0;
+ p->buf[p->count+3] = 0;
p->count+=4;
-
- }
}
break;
}
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev