Index: modules/demux/ts.c
===================================================================
--- modules/demux/ts.c	(revision 22200)
+++ modules/demux/ts.c	(working copy)
@@ -2892,6 +2892,7 @@
 
     ts_pid_t             **pp_clean = NULL;
     int                  i_clean = 0, i;
+    char		 *psz_aud_lang = NULL;
 
     msg_Dbg( p_demux, "PMTCallBack called" );
 
@@ -2984,6 +2985,9 @@
         }
     }
 
+    /* Retrieve audio-language.  Used to filter, if supplied by user */
+    psz_aud_lang = var_CreateGetString( p_demux, "audio-language" );
+
     for( p_es = p_pmt->p_first_es; p_es != NULL; p_es = p_es->p_next )
     {
         ts_pid_t tmp_pid, *old_pid = 0, *pid = &tmp_pid;
@@ -3600,7 +3604,44 @@
                     memcpy( pid->es->fmt.psz_language,
                             p_decoded->i_iso_639_code, 3 );
                     pid->es->fmt.psz_language[3] = 0;
+                    msg_Dbg( p_demux, "found language: %s", pid->es->fmt.psz_language);
 #endif
+                    if( pid->es->fmt.psz_language &&
+                        psz_aud_lang &&
+                        strlen( pid->es->fmt.psz_language ) &&
+                        strlen( psz_aud_lang ) )
+                    {
+                        if( !strcmp( pid->es->fmt.psz_language, "und" ) )
+                        {
+                            msg_Dbg( p_demux,
+                                    "ES language is '%s'.  Keeping ES.",
+                                    pid->es->fmt.psz_language );
+                        }
+                        else
+                        if( !strstr( psz_aud_lang, pid->es->fmt.psz_language ) )
+                        {
+                            msg_Dbg( p_demux,
+                                    "lang of %s doesn't match user supplied "
+                                    "lang of %s.  Discarding ES %d.",
+                                    pid->es->fmt.psz_language, psz_aud_lang,
+                                    p_es->i_pid );
+                            continue;
+                        }
+                        else
+                        {
+                            msg_Dbg( p_demux,
+                                    "lang of %s found in user supplied "
+                                    "lang of %s.  Keeping ES.",
+                                    pid->es->fmt.psz_language, psz_aud_lang );
+                        }
+                    }
+                    else
+                    {
+                        msg_Dbg( p_demux,
+                                "ES has lang of '%s', audio-language = '%s'."
+                                "  Keeping ES.",
+                                pid->es->fmt.psz_language, psz_aud_lang );
+                    }
                 }
             }
         }
