[MPlayer-cvslog] CVS: main/libmpdemux demux_mpg.c,1.58,1.59
Nico Sabbi CVS
syncmail at mplayerhq.hu
Sat Jun 25 15:25:29 CEST 2005
CVS change done by Nico Sabbi CVS
Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv2054
Modified Files:
demux_mpg.c
Log Message:
support raw ac3 (in private pes packets without the usual dvd 4 bytes substream header). Patch by Matthias Scharzott
Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mpg.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- demux_mpg.c 6 Jun 2005 21:30:53 -0000 1.58
+++ demux_mpg.c 25 Jun 2005 13:25:27 -0000 1.59
@@ -262,8 +262,22 @@
//============== DVD Audio sub-stream ======================
if(id==0x1BD){
- int aid=stream_read_char(demux->stream);--len;
- if(len<3) return -1; // invalid audio packet
+ int aid, rawa52 = 0;
+ off_t tmppos;
+ unsigned int tmp;
+
+ tmppos = stream_tell(demux->stream);
+ tmp = stream_read_word(demux->stream);
+ stream_seek(demux->stream, tmppos);
+ /// vdr stores A52 without the 4 header bytes, so we have to check this condition first
+ if(tmp == 0x0B77) {
+ aid = 128;
+ rawa52 = 1;
+ }
+ else {
+ aid=stream_read_char(demux->stream);--len;
+ if(len<3) return -1; // invalid audio packet
+ }
// AID:
// 0x20..0x3F subtitle
@@ -293,11 +307,13 @@
ds=demux->audio;
if(!ds->sh) ds->sh=demux->a_streams[aid];
// READ Packet: Skip additional audio header data:
+ if(!rawa52) {
c=stream_read_char(demux->stream);//num of frames
type=stream_read_char(demux->stream);//startpos hi
type=(type<<8)|stream_read_char(demux->stream);//startpos lo
// printf("\r[%02X][%04X]",c,type);
len-=3;
+ }
if((aid&0xE0)==0xA0 && len>=3){
unsigned char* hdr;
// save audio header as codecdata!
More information about the MPlayer-cvslog
mailing list