]> git.sesse.net Git - vlc/commitdiff
Remove dummy stream_t.pf_block
authorRémi Denis-Courmont <rem@videolan.org>
Fri, 20 Jul 2007 20:55:02 +0000 (20:55 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Fri, 20 Jul 2007 20:55:02 +0000 (20:55 +0000)
src/input/demux.c
src/input/input_internal.h
src/input/mem_stream.c
src/input/stream.c

index 2712f96d0064706dc6798cde3dfa358a142f56cd..91d2077e131f71dd977c6ff6aa5c53ebdb88d40b 100644 (file)
@@ -312,7 +312,6 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
     if( psz_demux == NULL || *psz_demux == '\0' ) return NULL;
 
     s = vlc_stream_create( p_obj );
-    s->pf_block  = NULL;
     s->pf_read   = DStreamRead;
     s->pf_peek   = DStreamPeek;
     s->pf_control= DStreamControl;
index 7c8d366faced4d56f5e2c42977712bdd37ac4034..9683b2c702fbcd4bfa3607edb17a06cb144fe6ab 100644 (file)
@@ -353,7 +353,7 @@ static inline int demux2_Control( demux_t *p_demux, int i_query, ... )
 }
 
 #if defined(__PLUGIN__) || defined(__BUILTIN__)
-# warning This is an internal header, please don't rely on it.
+# warning This is an internal header, something is wrong if you see this message.
 #else
 /* Stream */
 /**
@@ -363,7 +363,7 @@ struct stream_t
 {
     VLC_COMMON_MEMBERS
 
-    block_t *(*pf_block)  ( stream_t *, int i_size );
+    /*block_t *(*pf_block)  ( stream_t *, int i_size );*/
     int      (*pf_read)   ( stream_t *, void *p_read, int i_read );
     int      (*pf_peek)   ( stream_t *, const uint8_t **pp_peek, int i_peek );
     int      (*pf_control)( stream_t *, int i_query, va_list );
index d6f747c475097ef97ed2c6d102064e947fd4a850..5c49dfcde912acbd88fc208a7eadd9bbd26ac9e1 100644 (file)
@@ -63,7 +63,6 @@ stream_t *__stream_MemoryNew( vlc_object_t *p_this, uint8_t *p_buffer,
     p_sys->p_buffer = p_buffer;
     p_sys->i_preserve_memory = i_preserve_memory;
 
-    s->pf_block   = NULL;
     s->pf_read    = Read;
     s->pf_peek    = Peek;
     s->pf_control = Control;
index ab77a9fafed490a01d0a5810805a268619678cd5..4119e531e8a514ce08e22aed87313d77691739be 100644 (file)
@@ -232,7 +232,6 @@ stream_t *stream_AccessNew( access_t *p_access, vlc_bool_t b_quick )
     /* Attach it now, needed for b_die */
     vlc_object_attach( s, p_access );
 
-    s->pf_block  = NULL;
     s->pf_read   = NULL;    /* Set up later */
     s->pf_peek   = NULL;
     s->pf_control = AStreamControl;
@@ -1883,23 +1882,16 @@ block_t *stream_Block( stream_t *s, int i_size )
 {
     if( i_size <= 0 ) return NULL;
 
-    if( s->pf_block )
+    /* emulate block read */
+    block_t *p_bk = block_New( s, i_size );
+    if( p_bk )
     {
-        return s->pf_block( s, i_size );
-    }
-    else
-    {
-        /* emulate block read */
-        block_t *p_bk = block_New( s, i_size );
-        if( p_bk )
+        p_bk->i_buffer = stream_Read( s, p_bk->p_buffer, i_size );
+        if( p_bk->i_buffer > 0 )
         {
-            p_bk->i_buffer = stream_Read( s, p_bk->p_buffer, i_size );
-            if( p_bk->i_buffer > 0 )
-            {
-                return p_bk;
-            }
+            return p_bk;
         }
-        if( p_bk ) block_Release( p_bk );
-        return NULL;
     }
+    if( p_bk ) block_Release( p_bk );
+    return NULL;
 }