Hi all,
I have a mythtv box that has an Avermedia AV180 card, and can capture free DVB broadcasts via QAM. I also have a Hauppauge MVPMC device that can play them, except, that it doesn't do AC3 very well. So, I want to use VLC to transcode the AC3 to MP2. That works very well, except......
I have a couple of stations that transmit audio on more than one pid, in more than one language. And, it seems that the spanish is the first pid, so if I use vlc to transcode, it usually gives me the spanish track.
I checked all the lists I could see, and I see several requests for the ability to select specific PIDs out of a TS, but no solutions.
So, here is a rude, crude, first cut at a patch to allow one to select a specific audio pid by language, instead of being required to use the 1st one provided by said programming provider:
This fix comes from my debian packages, so the code may be slightly out of date, but it's out here for others to use, or to spark discussion, or if someone wants to include it, whatever. Mostly, it's to hopefully spark some discussion, as one post I saw seemed to have the attitude of, "quit whining and go code it."
--- modules/mux/mpeg/ps.c 2006-09-18 04:28:27.000000000 -0600
+++ ../vlc-0.8.6-svn20061012.debian-mine/modules/mux/mpeg/ps.c 2007-09-19 13:56:54.000000000 -0600
@@ -253,6 +253,11 @@
}
}
+#define GOOD_CHARS(a,b) \
+ ( ( a ) == ' ' || ( a ) == '\t' || \
+ ( b ) == ' ' || ( b ) == '\t' || \
+ ( a ) == ( b ) )
+
/*****************************************************************************
* AddStream:
*****************************************************************************/
@@ -375,6 +380,18 @@
msg_Dbg( p_mux, " - lang=%c%c%c",
p_stream->lang[0], p_stream->lang[1], p_stream->lang[2] );
}
+ psz = var_CreateGetString( p_mux, "audio-language" );
+ if( psz && strlen( psz ) )
+ {
+ if( ! ( GOOD_CHARS( psz[0], p_stream->lang[0] ) &&
+ GOOD_CHARS( psz[1], p_stream->lang[1] ) &&
+ GOOD_CHARS( psz[2], p_stream->lang[2] ) ) )
+ {
+ msg_Dbg( p_mux, " - lang doesn't match user lang of %s, dropping",
+ psz );
+ goto error;
+ }
+ }
}
return VLC_SUCCESS;