[Mplayer-dvb] ac3 sound in vdr file not recognized by mplayer and mencodWed Jan 2 21:40:31 2002

Arpi arpi at thot.banki.hu
Wed Jan 2 20:46:06 CET 2002


Hi,

> I don't know exactly, it was just a guess. I only know how the AC3
> stream in a TS looks like. I haven't taken a look at vdr and how it
> transforms the TS. In the TS there is no AC3 header, i.e. the first 4
> bytes after the PES header are missing, because the stream id is in
I see. It seems that VDR builds invalid VOB (mpeg pes) stream.
It just use 01BD instead of 01C0 as audio stream id, but forgets to add
the required sub-header (4 bytes: 1 id + 3 header) of 01BD-type streams.
My demuxer reads sub-stream id from first byte of ac3 packet, and as it's
always 0B, it find aid=0x0B which is incorrect.
As a hotfix, try this patch on CVS, works with uploaded sample file:
(I won't commit to the cvs, as it breaks DVD and any real mpeg streams with
ac3 audio. I think it's a bug of VDR, and hard to workaround in mplayer)

Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mpg.c,v
retrieving revision 1.37
diff -u -r1.37 demux_mpg.c
--- demux_mpg.c	2 Jan 2002 19:18:11 -0000	1.37
+++ demux_mpg.c	2 Jan 2002 19:47:16 -0000
@@ -123,7 +123,7 @@
     
     //============== DVD Audio sub-stream ======================
     if(id==0x1BD){
-      int aid=stream_read_char(demux->stream);--len;
+      int aid=128; //stream_read_char(demux->stream);--len;
       if(len<3) return -1; // invalid audio packet
       
       // AID:
@@ -144,10 +144,11 @@
             ds=demux->sub;
         }
           
-      } else if((aid & 0xC0) == 0x80 || (aid & 0xE0) == 0x00) {
+      } else if((aid & 0xC0) == 0x80) {
 
 //        aid=128+(aid&0x7F);
         // aid=0x80..0xBF
+//	if(aid<0x20) aid+=0x80; // hack
 
         if(!demux->a_streams[aid]) new_sh_audio(demux,aid);
         if(demux->audio->id==-1) demux->audio->id=aid;
@@ -157,11 +158,13 @@
         ds=demux->audio;
         if(!ds->sh) ds->sh=demux->a_streams[aid];
         // READ Packet: Skip additional audio header data:
+#if 0
         c=stream_read_char(demux->stream);//type=c;
         c=stream_read_char(demux->stream);//type|=c<<8;
         c=stream_read_char(demux->stream);//type|=c<<16;
 //        printf("[%06X]",type);
         len-=3;
+#endif
         if((aid&0xE0)==0xA0 && len>=2){
           // read PCM header
           int head;



A'rpi / Astral & ESP-team

--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu



More information about the MPlayer-dvb mailing list