--- modules/demux/ts.c.v11	2011-09-21 20:02:50.000000000 +0300
+++ modules/demux/ts.c	2011-09-21 20:03:17.000000000 +0300
@@ -140,8 +140,12 @@
 
 #define SEEK_PERCENT_TEXT N_("Seek based on percent not time")
 #define SEEK_PERCENT_LONGTEXT N_( \
-    "Seek based on a percent byte position, not a time position. " \
-    "If seeking doesn't work propery, turn on this option." )
+    "Seek and position based on a percent byte position, not a PCR generated " \
+    "time position. If seeking doesn't work propery, turn on this option." )
+
+#define DISABLE_PRC_TIME_TEXT N_("Disable PCR based length and time")
+#define DISABLE_PRC_TIME__LONGTEXT N_( \
+    "Disable PCR based length and time generation.")
 
 vlc_module_begin ()
     set_description( N_("MPEG Transport Stream demuxer") )
@@ -171,6 +175,7 @@
                  DUMPSIZE_LONGTEXT, true )
     add_bool( "ts-split-es", true, SPLIT_ES_TEXT, SPLIT_ES_LONGTEXT, false )
     add_bool( "ts-seek-percent", false, SEEK_PERCENT_TEXT, SEEK_PERCENT_LONGTEXT, true )
+    add_bool( "ts-disable-time", false, DISABLE_PRC_TIME_TEXT, DISABLE_PRC_TIME__LONGTEXT, true )
 
     set_capability( "demux", 10 )
     set_callbacks( Open, Close )
@@ -1174,12 +1179,17 @@
     {
     case DEMUX_GET_POSITION:
         pf = (double*) va_arg( args, double* );
+        int64_t i_time, i_length;
 
-        if( (p_sys->b_dvb_meta && p_sys->b_access_control) ||
+        if ( var_InheritBool( p_demux, "ts-seek-percent" ) &&
+	    (i64 = stream_Size( p_demux->s) ) > 0 )
+	{
+	    *pf = (double)stream_Tell( p_demux->s ) / (double)i64;
+	}
+        else if( (p_sys->b_dvb_meta && p_sys->b_access_control) ||
             p_sys->i_current_pcr - p_sys->i_first_pcr < 0 ||
             p_sys->i_last_pcr - p_sys->i_first_pcr <= 0 )
         {
-            int64_t i_time, i_length;
             if( !DVBEventInformation( p_demux, &i_time, &i_length ) && i_length > 0 )
                 *pf = (double)i_time/(double)i_length;
             else if( (i64 = stream_Size( p_demux->s) ) > 0 )
@@ -1215,7 +1225,12 @@
 
     case DEMUX_GET_TIME:
         pi64 = (int64_t*)va_arg( args, int64_t * );
-        if( (p_sys->b_dvb_meta && p_sys->b_access_control) ||
+        
+	if( var_InheritBool( p_demux, "ts-disable-time" ) )
+	{
+	    *pi64 = 0;
+        }
+        else if( (p_sys->b_dvb_meta && p_sys->b_access_control) ||
             p_sys->i_current_pcr - p_sys->i_first_pcr < 0 )
         {
             if( DVBEventInformation( p_demux, pi64, NULL ) )
@@ -1231,7 +1246,11 @@
 
     case DEMUX_GET_LENGTH:
         pi64 = (int64_t*)va_arg( args, int64_t * );
-        if( (p_sys->b_dvb_meta && p_sys->b_access_control) ||
+        if( var_InheritBool( p_demux, "ts-disable-time" ) )
+	{
+	    *pi64 = 0;
+	}
+        else if( (p_sys->b_dvb_meta && p_sys->b_access_control) ||
             p_sys->i_last_pcr - p_sys->i_first_pcr <= 0 )
         {
             if( DVBEventInformation( p_demux, NULL, pi64 ) )
