[vlc-commits] demux: asf: seek seekable

Francois Cartegnie git at videolan.org
Tue Nov 26 17:05:41 CET 2013


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 26 16:21:52 2013 +0100| [cd3efe2dc30147b9e0a32f9a039f59c139bc777c] | committer: Francois Cartegnie

demux: asf: seek seekable

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd3efe2dc30147b9e0a32f9a039f59c139bc777c
---

 modules/demux/asf/asf.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index fa1079c..8239340 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -314,6 +314,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         return VLC_SUCCESS;
 
     case DEMUX_SET_TIME:
+        if ( p_sys->p_fp &&
+             ! ( p_sys->p_fp->i_flags & ASF_FILE_PROPERTIES_SEEKABLE ) )
+            return VLC_EGENERIC;
+
         SeekPrepare( p_demux );
 
         if( p_sys->b_index && p_sys->i_length > 0 )
@@ -342,6 +346,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                                        i_query, args );
 
     case DEMUX_SET_POSITION:
+        if ( p_sys->p_fp &&
+             ! ( p_sys->p_fp->i_flags & ASF_FILE_PROPERTIES_SEEKABLE ) )
+            return VLC_EGENERIC;
+
         SeekPrepare( p_demux );
 
         if( p_sys->b_index && p_sys->i_length > 0 )
@@ -361,6 +369,16 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         vlc_meta_Merge( p_meta, p_sys->meta );
         return VLC_SUCCESS;
 
+    case DEMUX_CAN_SEEK:
+        if ( p_sys->p_fp &&
+             ! ( p_sys->p_fp->i_flags & ASF_FILE_PROPERTIES_SEEKABLE ) )
+        {
+            bool *pb_bool = (bool*)va_arg( args, bool * );
+            *pb_bool = false;
+            return VLC_SUCCESS;
+        }
+        // ft
+
     default:
         return demux_vaControlHelper( p_demux->s, p_sys->i_data_begin,
                                        p_sys->i_data_end, p_sys->i_bitrate,



More information about the vlc-commits mailing list