Re: missing audio on Wall-E Blu-Ray

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]<

 



Il giorno gio, 01/01/2009 alle 13.22 +0100, Nico Sabbi ha scritto:
> Il giorno mer, 31/12/2008 alle 19.24 -0500, Eric Sharkey ha scritto:
> > On Wed, Dec 31, 2008 at 5:27 AM, Nico Sabbi <nicola.sabbi@xxxxxxxx> wrote:
> > > ahhhhh, that horror in action!
> > > There are 8192 pids in a transport stream and what did those bastard
> > > idiots do? Use a single pid (a substream in the TS) to carry 2 or more
> > > audio streams. Can anyone be more _IDIOT_ , willing or not ?
> > >
> > > I'm not very inclined to support that shit, but if you upload a sample
> > > and if I find some good mood I may give it a look without any promise.
> > 
> > Is it really any worse than the whole BluRay DRM fiasco?
> > 
> > I've uploaded the first 32MB of the file as walle_start.m2ts.  I'd appreciate
> > anything you can do.  I'd imagine that this affects more than just me.
> > 
> > Thanks,
> > 
> > Eric Sharkey
> 
> the good news is that all audio streams play well, although ffdca
> complains of the presence of invalid DCA frames; the bad news is that
> I can't yet find how the second stream is laid out, assuming there *is*
> a second audio stream. I asked clarifications to the ffmpeg-devel 
> 


well, I found out that the substreams are identified by the first
byte in the pes_extension2 payload.
The best that can be done is to let the user specify the substream_id
he want to play, because the "right one" isn't qualified in the PMT,
and even so the codec assignment can be wrong for the same reason.

Thank those genial designers for this mess.

Try the attached patch specifying -ausid 0x71
Index: cfg-common.h
===================================================================
--- cfg-common.h	(revisione 27896)
+++ cfg-common.h	(copia locale)
@@ -53,6 +53,7 @@
 extern int ts_prog;
 extern int ts_keep_broken;
 extern off_t ts_probe;
+extern int audio_substream_id=-1;
 extern off_t ps_probe;
 
 #include "stream/tv.h"
Index: cfg-common-opts.h
===================================================================
--- cfg-common-opts.h	(revisione 27896)
+++ cfg-common-opts.h	(copia locale)
@@ -122,6 +122,7 @@
 
 	// select audio/video/subtitle stream
 	{"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 8190, NULL},
+	{"ausid", &audio_substream_id, CONF_TYPE_INT, 0, 0, 0, NULL},
 	{"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 8190, NULL},
 	{"sid", &dvdsub_id, CONF_TYPE_INT, CONF_RANGE, 0, 8190, NULL},
 	{"novideo", &video_id, CONF_TYPE_FLAG, 0, -1, -2, NULL},
Index: libmpdemux/demux_ts.c
===================================================================
--- libmpdemux/demux_ts.c	(revisione 27896)
+++ libmpdemux/demux_ts.c	(copia locale)
@@ -59,6 +59,7 @@
 int ts_prog;
 int ts_keep_broken=0;
 off_t ts_probe = 0;
+int audio_substream_id = -1;
 extern char *dvdsub_lang, *audio_lang;	//for -alang
 
 typedef enum
@@ -1287,6 +1288,7 @@
 	int64_t        pts;
 	uint32_t       stream_id;
 	uint32_t       pkt_len, pes_is_aligned;
+	uint32_t       skip;
 
 	//Here we are always at the start of a PES packet
 	mp_msg(MSGT_DEMUX, MSGL_DBG2, "pes_parse2(%p, %d): \n", buf, (uint32_t) packet_len);
@@ -1343,6 +1345,62 @@
 		mp_msg(MSGT_DEMUX, MSGL_DBG2, "demux_ts: illegal value for PES_header_data_length (0x%02x)\n", header_len);
 		return 0;
 	}
+	
+	skip = 9;
+	if(p[7] & 0x80)
+	{
+		skip += 5;
+		if(p[7] & 0x40)
+			skip += 5;
+	}
+	if(p[7] & 0x20)	//escr_flag
+		skip += 6;
+	if(p[7] & 0x10)	//es_rate_flag
+		skip += 3;
+	if(p[7] & 0x08)//dsm_trick_mode is unsupported, skip
+	{
+		skip = 0;//don't let's parse the extension fields
+	}
+	if(p[7] & 0x04)	//additional_copy_info
+		skip += 1;
+	if(p[7] & 0x02)	//pes_crc_flag
+		skip += 2;
+	if(audio_substream_id!=-1 && skip && stream_id==0xfd && (p[7] & 0x01))
+	{
+		//parse the extension_field
+		unsigned char flags;
+		if(skip >= pkt_len)
+			return 0;
+		flags = p[skip];
+		skip++;
+		if(flags & 0x80)	//pes_private_data_flag
+			skip += 16;
+		if(skip >= pkt_len)
+			return 0;
+		if(flags & 0x40)	//pack_header_field_flag
+		{
+			unsigned char l = p[skip];
+			skip += l;
+		}
+		if(flags & 0x20)	//program_packet_sequence_counter
+			skip += 2;
+		if(flags & 0x10)	//p_std
+			skip += 2;
+		if(skip >= pkt_len)
+			return 0;
+		if(flags & 0x01)	//finally the long desired pes_extension2
+		{
+			unsigned char l = p[skip];	//ext2 flag+len
+			skip++;
+			if(l == 0x81)
+			{
+				if(skip >= pkt_len)
+					return 0;
+				if(p[skip]!=audio_substream_id)
+					return 0;
+			}
+		}
+	}
 
 	p += header_len + 9;
 	packet_len -= header_len + 3;
_______________________________________________
MPlayer-users mailing list
MPlayer-users@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux