Patch to choose Audio PID from PS by language

Want to help the VideoLAN project? Designers, testers, translators, please come...
This is NOT about GETTING some help.
Forum rules
Please read the forum's rules carefully before posting. This forum should not be used to post VLC usage related questions.
mgpaulus
New Cone
New Cone
Posts: 2
Joined: 07 Nov 2006 15:53

Patch to choose Audio PID from PS by language

Postby mgpaulus » 19 Sep 2007 22:01

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;

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Patch to choose Audio PID from PS by language

Postby Jean-Baptiste Kempf » 20 Sep 2007 10:42

Can you send the patch against SVN trunk and not 0.8.6 ? Can you send the patch to vlc-devel mailing list? Thanks a lot.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Contribute and help the VideoLAN project”

Who is online

Users browsing this forum: No registered users and 16 guests