[vlc-commits] stream: remove STREAM_GET_PRIVATE_BLOCK

Rémi Denis-Courmont git at videolan.org
Thu Jul 21 21:30:17 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 20 00:11:17 2016 +0300| [c9973b6fe981749740a001c68b135d250ac56663] | committer: Rémi Denis-Courmont

stream: remove STREAM_GET_PRIVATE_BLOCK

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

 include/vlc_stream.h                |    1 -
 modules/stream_filter/cache_block.c |   23 ++++-------------------
 src/input/access.c                  |   20 +-------------------
 src/input/stream.c                  |   26 --------------------------
 4 files changed, 5 insertions(+), 65 deletions(-)

diff --git a/include/vlc_stream.h b/include/vlc_stream.h
index e8c1bc6..a2dda0f 100644
--- a/include/vlc_stream.h
+++ b/include/vlc_stream.h
@@ -160,7 +160,6 @@ enum stream_query_e
     STREAM_SET_PRIVATE_ID_STATE = 0x1000, /* arg1= int i_private_data, bool b_selected    res=can fail */
     STREAM_SET_PRIVATE_ID_CA,             /* arg1= int i_program_number, uint16_t i_vpid, uint16_t i_apid1, uint16_t i_apid2, uint16_t i_apid3, uint8_t i_length, uint8_t *p_data */
     STREAM_GET_PRIVATE_ID_STATE,          /* arg1=int i_private_data arg2=bool *          res=can fail */
-    STREAM_GET_PRIVATE_BLOCK, /**< arg1= block_t **b, arg2=bool *eof */
 };
 
 /**
diff --git a/modules/stream_filter/cache_block.c b/modules/stream_filter/cache_block.c
index 7695fac..623dee5 100644
--- a/modules/stream_filter/cache_block.c
+++ b/modules/stream_filter/cache_block.c
@@ -85,18 +85,6 @@ struct stream_sys_t
     } stat;
 };
 
-static block_t *AReadBlock(stream_t *s, bool *restrict eof)
-{
-    block_t *block;
-
-    if (stream_Control(s->p_source, STREAM_GET_PRIVATE_BLOCK, &block, eof))
-    {
-        block = NULL;
-        *eof = true;
-    }
-    return block;
-}
-
 static int AStreamRefillBlock(stream_t *s)
 {
     stream_sys_t *sys = s->p_sys;
@@ -127,15 +115,13 @@ static int AStreamRefillBlock(stream_t *s)
 
     for (;;)
     {
-        bool b_eof;
-
         if (vlc_killed())
             return VLC_EGENERIC;
 
         /* Fetch a block */
-        if ((b = AReadBlock(s, &b_eof)))
+        if ((b = stream_ReadBlock(s->p_source)))
             break;
-        if (b_eof)
+        if (stream_Eof(s->p_source))
             return VLC_EGENERIC;
     }
 
@@ -190,11 +176,10 @@ static void AStreamPrebufferBlock(stream_t *s)
         }
 
         /* Fetch a block */
-        bool eof;
-        block_t *b = AReadBlock(s, &eof);
+        block_t *b = stream_ReadBlock(s->p_source);
         if (b == NULL)
         {
-            if (eof)
+            if (stream_Eof(s->p_source))
                 break;
             continue;
         }
diff --git a/src/input/access.c b/src/input/access.c
index 0864073..09a6551 100644
--- a/src/input/access.c
+++ b/src/input/access.c
@@ -285,25 +285,7 @@ static int AStreamControl(stream_t *s, int cmd, va_list args)
 {
     access_t *access = s->p_sys;
 
-    switch (cmd)
-    {
-        case STREAM_GET_PRIVATE_BLOCK:
-        {
-            block_t **b = va_arg(args, block_t **);
-            bool *eof = va_arg(args, bool *);
-
-            if (access->pf_block == NULL)
-                return VLC_EGENERIC;
-
-            *b = vlc_access_Eof(access) ? NULL : vlc_access_Block(access);
-            *eof = (*b == NULL) && vlc_access_Eof(access);
-            break;
-        }
-
-        default:
-            return access_vaControl(access, cmd, args);
-    }
-    return VLC_SUCCESS;
+    return access_vaControl(access, cmd, args);
 }
 
 static void AStreamDestroy(stream_t *s)
diff --git a/src/input/stream.c b/src/input/stream.c
index dc109a0..f5de439 100644
--- a/src/input/stream.c
+++ b/src/input/stream.c
@@ -621,17 +621,6 @@ int stream_Seek(stream_t *s, uint64_t offset)
     return VLC_SUCCESS;
 }
 
-static int stream_ControlInternal(stream_t *s, int cmd, ...)
-{
-    va_list ap;
-    int ret;
-
-    va_start(ap, cmd);
-    ret = s->pf_control(s, cmd, ap);
-    va_end(ap);
-    return ret;
-}
-
 /**
  * Use to control the "stream_t *". Look at #stream_query_e for
  * possible "i_query" value and format arguments.  Return VLC_SUCCESS
@@ -666,21 +655,6 @@ int stream_vaControl(stream_t *s, int cmd, va_list args)
 
             return VLC_SUCCESS;
         }
-
-        case STREAM_GET_PRIVATE_BLOCK:
-        {
-            block_t **b = va_arg(args, block_t **);
-            bool *eof = va_arg(args, bool *);
-
-            if (priv->peek != NULL)
-            {
-                *b = priv->peek;
-                priv->peek = NULL;
-                *eof = false;
-                return VLC_SUCCESS;
-            }
-            return stream_ControlInternal(s, STREAM_GET_PRIVATE_BLOCK, b, eof);
-        }
     }
     return s->pf_control(s, cmd, args);
 }



More information about the vlc-commits mailing list