summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-06-25 13:25:27 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-06-25 13:25:27 +0000
commit999ac17eba3379c4e6c7f725d366503345ee60e5 (patch)
tree3771a411a769a651e54c9b5f639e525b70893eca /libmpdemux
parent4249304686c2ac7c95b3fb8e95e69e620ea574cc (diff)
downloadmpv-999ac17eba3379c4e6c7f725d366503345ee60e5.tar.bz2
mpv-999ac17eba3379c4e6c7f725d366503345ee60e5.tar.xz
support raw ac3 (in private pes packets without the usual dvd 4 bytes substream header). Patch by Matthias Scharzott
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15816 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mpg.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c
index f4b6373f2a..9b94919a70 100644
--- a/libmpdemux/demux_mpg.c
+++ b/libmpdemux/demux_mpg.c
@@ -262,8 +262,22 @@ static int demux_mpg_read_packet(demuxer_t *demux,int id){
//============== 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 @@ static int demux_mpg_read_packet(demuxer_t *demux,int id){
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!