]> git.sesse.net Git - vlc/blobdiff - modules/demux/ps.c
Used VLC_CODEC_* and vlc_fourcc_GetCodec when suitable.
[vlc] / modules / demux / ps.c
index e2b6c3774afa8e3319d27c23a3779bcbb002ff64..66b289219b11add189904f99c6a3ebcdbe03b505 100644 (file)
@@ -68,6 +68,7 @@ vlc_module_begin ()
     set_description( N_("MPEG-PS demuxer") )
     set_capability( "demux", 8 )
     set_callbacks( Open, Close )
+    add_shortcut( "ps" )
 vlc_module_end ()
 
 /*****************************************************************************
@@ -387,7 +388,7 @@ static int Demux( demux_t *p_demux )
             if( tk->b_seen && tk->es &&
                 (
 #ifdef ZVBI_COMPILED /* FIXME!! */
-                tk->fmt.i_codec == VLC_FOURCC('t','e','l','x') ||
+                tk->fmt.i_codec == VLC_CODEC_TELETEXT ||
 #endif
                 !ps_pkt_parse_pes( p_pkt, tk->i_skip ) ) )
             {
@@ -491,9 +492,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             {
                 int64_t i_now = p_sys->i_current_pts - p_sys->tk[p_sys->i_time_track].i_first_pts;
                 int64_t i_pos = stream_Tell( p_demux->s );
-                int64_t i_offset = i_pos / (i_now / 1000000) * ((i64 - i_now) / 1000000);
-                stream_Seek( p_demux->s, i_pos + i_offset);
 
+                if( !i_now )
+                    return i64 ? VLC_EGENERIC : VLC_SUCCESS;
+
+                i_pos *= (float)i64 / (float)i_now;
+                stream_Seek( p_demux->s, i_pos );
                 return VLC_SUCCESS;
             }
             return VLC_EGENERIC;