[vlc-devel] [PATCH 03/17] Stream output: Use vlc_frame_t

Denis Charmet typx at dinauz.org
Mon Apr 22 19:10:32 CEST 2019


* ES are in vlc_frame_t format
* For output pacing control so are access_out packets
---
 modules/access_output/dummy.c                 |  10 +-
 modules/access_output/file.c                  |  55 +++--
 modules/access_output/http.c                  |  45 ++--
 modules/access_output/livehttp.c              |  59 +++--
 modules/access_output/rist.c                  |  54 ++---
 modules/access_output/shout.c                 |  11 +-
 modules/access_output/srt.c                   |  11 +-
 modules/access_output/udp.c                   |  43 ++--
 modules/mux/asf.c                             |  58 ++---
 modules/mux/av1_pack.h                        |  44 ++--
 modules/mux/avi.c                             |  48 ++--
 modules/mux/dummy.c                           |  13 +-
 modules/mux/mp4/libmp4mux.c                   |   4 +-
 modules/mux/mp4/mp4.c                         | 170 ++++++-------
 modules/mux/mpeg/pes.c                        |  26 +-
 modules/mux/mpeg/pes.h                        |   2 +-
 modules/mux/mpeg/ps.c                         |  46 ++--
 modules/mux/mpeg/tables.c                     |  22 +-
 modules/mux/mpeg/tables.h                     |   2 +-
 modules/mux/mpeg/ts.c                         | 164 ++++++-------
 modules/mux/mpeg/tsutil.c                     |  10 +-
 modules/mux/mpeg/tsutil.h                     |   4 +-
 modules/mux/mpjpeg.c                          |  14 +-
 modules/mux/ogg.c                             |  72 +++---
 modules/mux/wav.c                             |  28 +--
 modules/stream_out/autodel.c                  |   8 +-
 modules/stream_out/bridge.c                   |  35 ++-
 modules/stream_out/chromaprint.c              |  12 +-
 modules/stream_out/chromecast/cast.cpp        | 116 ++++-----
 modules/stream_out/cycle.c                    |  20 +-
 modules/stream_out/delay.c                    |  20 +-
 modules/stream_out/description.c              |   7 +-
 modules/stream_out/display.c                  |   8 +-
 modules/stream_out/dlna/dlna.cpp              |   5 +-
 modules/stream_out/dummy.c                    |   8 +-
 modules/stream_out/duplicate.c                |  12 +-
 modules/stream_out/es.c                       |   4 +-
 modules/stream_out/gather.c                   |   8 +-
 modules/stream_out/mosaic_bridge.c            |   8 +-
 modules/stream_out/record.c                   |  70 +++---
 modules/stream_out/rtcp.c                     |   4 +-
 modules/stream_out/rtp.c                      |  52 ++--
 modules/stream_out/rtp.h                      |   8 +-
 modules/stream_out/rtpfmt.c                   | 223 +++++++++---------
 modules/stream_out/sdi/AES3Audio.cpp          |  20 +-
 modules/stream_out/sdi/AES3Audio.hpp          |   7 +-
 modules/stream_out/sdi/DBMSDIOutput.cpp       |  26 +-
 modules/stream_out/sdi/DBMSDIOutput.hpp       |   6 +-
 modules/stream_out/sdi/SDIAudioMultiplex.cpp  |  20 +-
 modules/stream_out/sdi/SDIAudioMultiplex.hpp  |   2 +-
 modules/stream_out/sdi/SDIOutput.cpp          |   6 +-
 modules/stream_out/sdi/SDIOutput.hpp          |   4 +-
 modules/stream_out/sdi/SDIStream.cpp          |  37 ++-
 modules/stream_out/sdi/SDIStream.hpp          |  20 +-
 modules/stream_out/setid.c                    |   4 +-
 modules/stream_out/smem.c                     |  23 +-
 modules/stream_out/standard.c                 |   2 +-
 modules/stream_out/stats.c                    |  28 +--
 modules/stream_out/transcode/audio.c          |  22 +-
 modules/stream_out/transcode/encoder/audio.c  |  14 +-
 .../stream_out/transcode/encoder/encoder.c    |  10 +-
 .../stream_out/transcode/encoder/encoder.h    |   6 +-
 .../transcode/encoder/encoder_priv.h          |  12 +-
 modules/stream_out/transcode/encoder/spu.c    |   2 +-
 modules/stream_out/transcode/encoder/video.c  |  30 +--
 modules/stream_out/transcode/spu.c            |  10 +-
 modules/stream_out/transcode/transcode.c      |   8 +-
 modules/stream_out/transcode/transcode.h      |  10 +-
 modules/stream_out/transcode/video.c          |  18 +-
 modules/stream_out/vod.c                      |  26 +-
 70 files changed, 1000 insertions(+), 1016 deletions(-)

diff --git a/modules/access_output/dummy.c b/modules/access_output/dummy.c
index 863953228a..2c495718e2 100644
--- a/modules/access_output/dummy.c
+++ b/modules/access_output/dummy.c
@@ -31,7 +31,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -52,7 +51,7 @@ vlc_module_end ()
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *, block_t * );
+static ssize_t Write( sout_access_out_t *, vlc_frame_t * );
 
 /*****************************************************************************
  * Open: open the file
@@ -69,19 +68,18 @@ static int Open( vlc_object_t *p_this )
 /*****************************************************************************
  * Read: standard read on a file descriptor.
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     size_t i_write = 0;
-    block_t *b = p_buffer;
+    vlc_frame_t *b = p_buffer;
 
     while( b )
     {
         i_write += b->i_buffer;
-
         b = b->p_next;
     }
 
-    block_ChainRelease( p_buffer );
+    vlc_frame_ChainRelease( p_buffer );
 
     (void)p_access;
     return i_write;
diff --git a/modules/access_output/file.c b/modules/access_output/file.c
index c983e3a8f0..dae2851806 100644
--- a/modules/access_output/file.c
+++ b/modules/access_output/file.c
@@ -43,7 +43,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 #include <vlc_fs.h>
 #include <vlc_network.h>
 #include <vlc_strings.h>
@@ -61,7 +60,7 @@
 /*****************************************************************************
  * Read: standard read on a file descriptor.
  *****************************************************************************/
-static ssize_t Read( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Read( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     int *fdp = p_access->p_sys, fd = *fdp;
     ssize_t val;
@@ -75,7 +74,7 @@ static ssize_t Read( sout_access_out_t *p_access, block_t *p_buffer )
 /*****************************************************************************
  * Write: standard write on a file descriptor.
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     int *fdp = p_access->p_sys, fd = *fdp;
     size_t i_write = 0;
@@ -87,15 +86,15 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         {
             if (errno == EINTR)
                 continue;
-            block_ChainRelease (p_buffer);
+            vlc_frame_ChainRelease (p_buffer);
             msg_Err( p_access, "cannot write: %s", vlc_strerror_c(errno) );
             return -1;
         }
 
         if ((size_t)val >= p_buffer->i_buffer)
         {
-            block_t *p_next = p_buffer->p_next;
-            block_Release (p_buffer);
+            vlc_frame_t *p_next = p_buffer->p_next;
+            vlc_frame_Release (p_buffer);
             p_buffer = p_next;
         }
         else
@@ -108,29 +107,29 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
     return i_write;
 }
 
-static ssize_t WritePipe(sout_access_out_t *access, block_t *block)
+static ssize_t WritePipe(sout_access_out_t *access, vlc_frame_t *frame)
 {
     int *fdp = access->p_sys, fd = *fdp;
     ssize_t total = 0;
 
-    while (block != NULL)
+    while (frame != NULL)
     {
-        if (block->i_buffer == 0)
+        if (frame->i_buffer == 0)
         {
-            block_t *next = block->p_next;
-            block_Release(block);
-            block = next;
+            vlc_frame_t *next = frame->p_next;
+            vlc_frame_Release(frame);
+            frame = next;
             continue;
         }
 
         /* TODO: vectorized I/O with writev() */
-        ssize_t val = vlc_write(fd, block->p_buffer, block->i_buffer);
+        ssize_t val = vlc_write(fd, frame->p_buffer, frame->i_buffer);
         if (val < 0)
         {
             if (errno == EINTR)
                 continue;
 
-            block_ChainRelease(block);
+            vlc_frame_ChainRelease(frame);
             msg_Err(access, "cannot write: %s", vlc_strerror_c(errno));
             total = -1;
             break;
@@ -138,46 +137,46 @@ static ssize_t WritePipe(sout_access_out_t *access, block_t *block)
 
         total += val;
 
-        assert((size_t)val <= block->i_buffer);
-        block->p_buffer += val;
-        block->i_buffer -= val;
+        assert((size_t)val <= frame->i_buffer);
+        frame->p_buffer += val;
+        frame->i_buffer -= val;
     }
 
     return total;
 }
 
 #ifdef S_ISSOCK
-static ssize_t Send(sout_access_out_t *access, block_t *block)
+static ssize_t Send(sout_access_out_t *access, vlc_frame_t *frame)
 {
     int *fdp = access->p_sys, fd = *fdp;
     size_t total = 0;
 
-    while (block != NULL)
+    while (frame != NULL)
     {
-        if (block->i_buffer == 0)
+        if (frame->i_buffer == 0)
         {
-            block_t *next = block->p_next;
-            block_Release(block);
-            block = next;
+            vlc_frame_t *next = frame->p_next;
+            vlc_frame_Release(frame);
+            frame = next;
             continue;
         }
 
         /* TODO: vectorized I/O with sendmsg() */
-        ssize_t val = send(fd, block->p_buffer, block->i_buffer, MSG_NOSIGNAL);
+        ssize_t val = send(fd, frame->p_buffer, frame->i_buffer, MSG_NOSIGNAL);
         if (val <= 0)
         {   /* FIXME: errno is meaningless if val is zero */
             if (errno == EINTR)
                 continue;
-            block_ChainRelease(block);
+            vlc_frame_ChainRelease(frame);
             msg_Err(access, "cannot write: %s", vlc_strerror_c(errno));
             return -1;
         }
 
         total += val;
 
-        assert((size_t)val <= block->i_buffer);
-        block->p_buffer += val;
-        block->i_buffer -= val;
+        assert((size_t)val <= frame->i_buffer);
+        frame->p_buffer += val;
+        frame->i_buffer -= val;
     }
     return total;
 }
diff --git a/modules/access_output/http.c b/modules/access_output/http.c
index 3d3085c449..81d674265c 100644
--- a/modules/access_output/http.c
+++ b/modules/access_output/http.c
@@ -34,7 +34,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 
 
 #include <vlc_input.h>
@@ -87,7 +86,7 @@ static const char *const ppsz_sout_options[] = {
     "user", "pwd", "mime", "metacube", NULL
 };
 
-static ssize_t Write( sout_access_out_t *, block_t * );
+static ssize_t Write( sout_access_out_t *, vlc_frame_t * );
 static int Control( sout_access_out_t *, int, va_list );
 
 typedef struct
@@ -334,7 +333,7 @@ static int Control( sout_access_out_t *p_access, int i_query, va_list args )
 /*****************************************************************************
  * Write:
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     int i_err = 0;
@@ -342,9 +341,9 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 
     while( p_buffer )
     {
-        block_t *p_next;
+        vlc_frame_t *p_next;
 
-        if( p_buffer->i_flags & BLOCK_FLAG_HEADER )
+        if( p_buffer->i_flags & FRAME_FLAG_HEADER )
         {
             /* gather header */
             if( p_sys->b_header_complete )
@@ -379,21 +378,21 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
                 hdr.csum = hton16( metacube2_compute_crc( &hdr ) );
 
                 int i_header_size = p_sys->i_header_size + sizeof( hdr );
-                block_t *p_hdr_block = block_Alloc( i_header_size );
-                if( p_hdr_block == NULL ) {
-                    block_ChainRelease( p_buffer );
+                vlc_frame_t *p_hdr_frame = vlc_frame_Alloc( i_header_size );
+                if( p_hdr_frame == NULL ) {
+                    vlc_frame_ChainRelease( p_buffer );
                     return VLC_ENOMEM;
                 }
-                p_hdr_block->i_flags = 0;
-                memcpy( p_hdr_block->p_buffer, &hdr, sizeof( hdr ) );
-                memcpy( p_hdr_block->p_buffer + sizeof( hdr ), p_sys->p_header, p_sys->i_header_size );
+                p_hdr_frame->i_flags = 0;
+                memcpy( p_hdr_frame->p_buffer, &hdr, sizeof( hdr ) );
+                memcpy( p_hdr_frame->p_buffer + sizeof( hdr ), p_sys->p_header, p_sys->i_header_size );
 
                 /* send the combined header here instead of sending them as regular
                  * data, so that we get them as a single Metacube header block */
-                httpd_StreamHeader( p_sys->p_httpd_stream, p_hdr_block->p_buffer, p_hdr_block->i_buffer );
-                httpd_StreamSend( p_sys->p_httpd_stream, p_hdr_block );
+                httpd_StreamHeader( p_sys->p_httpd_stream, p_hdr_frame->p_buffer, p_hdr_frame->i_buffer );
+                httpd_StreamSend( p_sys->p_httpd_stream, p_hdr_frame );
 
-                block_Release( p_hdr_block );
+                vlc_frame_Release( p_hdr_frame );
             }
             else
             {
@@ -404,7 +403,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 
         i_len += p_buffer->i_buffer;
 
-        if( p_buffer->i_flags & BLOCK_FLAG_TYPE_I )
+        if( p_buffer->i_flags & FRAME_FLAG_TYPE_I )
         {
             p_sys->b_has_keyframes = true;
         }
@@ -414,8 +413,8 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         if( p_sys->b_metacube )
         {
             /* header data is combined into one packet and sent earlier */
-            if( p_buffer->i_flags & BLOCK_FLAG_HEADER ) {
-                block_Release( p_buffer );
+            if( p_buffer->i_flags & FRAME_FLAG_HEADER ) {
+                vlc_frame_Release( p_buffer );
                 p_buffer = p_next;
                 continue;
             }
@@ -425,15 +424,15 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
             memcpy( hdr.sync, METACUBE2_SYNC, sizeof( METACUBE2_SYNC ) );
             hdr.size = hton32( p_buffer->i_buffer );
             hdr.flags = hton16( 0 );
-            if( p_buffer->i_flags & BLOCK_FLAG_HEADER )
+            if( p_buffer->i_flags & FRAME_FLAG_HEADER )
                 hdr.flags |= hton16( METACUBE_FLAGS_HEADER );
-            if( p_sys->b_has_keyframes && !( p_buffer->i_flags & BLOCK_FLAG_TYPE_I ) )
+            if( p_sys->b_has_keyframes && !( p_buffer->i_flags & FRAME_FLAG_TYPE_I ) )
                 hdr.flags |= hton16( METACUBE_FLAGS_NOT_SUITABLE_FOR_STREAM_START );
             hdr.csum = hton16( metacube2_compute_crc( &hdr ) );
 
-            p_buffer = block_Realloc( p_buffer, sizeof( hdr ), p_buffer->i_buffer );
+            p_buffer = vlc_frame_Realloc( p_buffer, sizeof( hdr ), p_buffer->i_buffer );
             if( p_buffer == NULL ) {
-                block_ChainRelease( p_next );
+                vlc_frame_ChainRelease( p_next );
                 return VLC_ENOMEM;
             }
             memcpy( p_buffer->p_buffer, &hdr, sizeof( hdr ) );
@@ -442,7 +441,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         /* send data */
         i_err = httpd_StreamSend( p_sys->p_httpd_stream, p_buffer );
 
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
         p_buffer = p_next;
 
         if( i_err < 0 )
@@ -453,7 +452,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 
     if( i_err < 0 )
     {
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
     }
 
     return( i_err < 0 ? VLC_EGENERIC : i_len );
diff --git a/modules/access_output/livehttp.c b/modules/access_output/livehttp.c
index 7c44f610ea..5ee57e5cf8 100644
--- a/modules/access_output/livehttp.c
+++ b/modules/access_output/livehttp.c
@@ -39,7 +39,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 #include <vlc_fs.h>
 #include <vlc_strings.h>
 #include <vlc_charset.h>
@@ -159,7 +158,7 @@ static const char *const ppsz_sout_options[] = {
     NULL
 };
 
-static ssize_t Write( sout_access_out_t *, block_t * );
+static ssize_t Write( sout_access_out_t *, vlc_frame_t * );
 static int Control( sout_access_out_t *, int, va_list );
 
 typedef struct output_segment
@@ -185,10 +184,10 @@ typedef struct
     uint32_t i_segment;
     size_t  i_seglen;
     float   f_seglen;
-    block_t *full_segments;
-    block_t **full_segments_end;
-    block_t *ongoing_segment;
-    block_t **ongoing_segment_end;
+    vlc_frame_t *full_segments;
+    vlc_frame_t **full_segments_end;
+    vlc_frame_t *ongoing_segment;
+    vlc_frame_t **ongoing_segment_end;
     int i_handle;
     unsigned i_numsegs;
     unsigned i_initial_segment;
@@ -208,7 +207,7 @@ typedef struct
 
 static int LoadCryptFile( sout_access_out_t *p_access);
 static int CryptSetup( sout_access_out_t *p_access, char *keyfile );
-static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer );
+static int CheckSegmentChange( sout_access_out_t *p_access, vlc_frame_t *p_buffer );
 static ssize_t writeSegment( sout_access_out_t *p_access );
 static ssize_t openNextFile( sout_access_out_t *p_access, sout_access_out_sys_t *p_sys );
 /*****************************************************************************
@@ -761,25 +760,25 @@ static void Close( vlc_object_t * p_this )
     sout_access_out_sys_t *p_sys = p_access->p_sys;
 
     if( p_sys->ongoing_segment )
-        block_ChainLastAppend( &p_sys->full_segments_end, p_sys->ongoing_segment );
+        vlc_frame_ChainLastAppend( &p_sys->full_segments_end, p_sys->ongoing_segment );
     p_sys->ongoing_segment = NULL;
     p_sys->ongoing_segment_end = &p_sys->ongoing_segment;
 
-    block_t *output_block = p_sys->full_segments;
+    vlc_frame_t *output_frame = p_sys->full_segments;
     p_sys->full_segments = NULL;
     p_sys->full_segments_end = &p_sys->full_segments;
 
-    while( output_block )
+    while( output_frame )
     {
-        block_t *p_next = output_block->p_next;
-        output_block->p_next = NULL;
+        vlc_frame_t *p_next = output_frame->p_next;
+        output_frame->p_next = NULL;
 
-        Write( p_access, output_block );
-        output_block = p_next;
+        Write( p_access, output_frame );
+        output_frame = p_next;
     }
     if( p_sys->ongoing_segment )
     {
-        block_ChainLastAppend( &p_sys->full_segments_end, p_sys->ongoing_segment );
+        vlc_frame_ChainLastAppend( &p_sys->full_segments_end, p_sys->ongoing_segment );
         p_sys->ongoing_segment = NULL;
         p_sys->ongoing_segment_end = &p_sys->ongoing_segment;
     }
@@ -789,9 +788,9 @@ static void Close( vlc_object_t * p_this )
     if( unlikely( writevalue < 0 ) )
     {
         if( p_sys->full_segments )
-            block_ChainRelease( p_sys->full_segments );
+            vlc_frame_ChainRelease( p_sys->full_segments );
         if( p_sys->ongoing_segment )
-            block_ChainRelease( p_sys->ongoing_segment );
+            vlc_frame_ChainRelease( p_sys->ongoing_segment );
     }
 
     closeCurrentSegment( p_access, p_sys, true );
@@ -903,7 +902,7 @@ static ssize_t openNextFile( sout_access_out_t *p_access, sout_access_out_sys_t
 /*****************************************************************************
  * CheckSegmentChange: Check if segment needs to be closed and new opened
  *****************************************************************************/
-static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer )
+static int CheckSegmentChange( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     ssize_t writevalue = 0;
@@ -914,7 +913,7 @@ static int CheckSegmentChange( sout_access_out_t *p_access, block_t *p_buffer )
         writevalue = writeSegment( p_access );
         if( unlikely( writevalue < 0 ) )
         {
-            block_ChainRelease ( p_buffer );
+            vlc_frame_ChainRelease ( p_buffer );
             return -1;
         }
         closeCurrentSegment( p_access, p_sys, false );
@@ -944,7 +943,7 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     msg_Dbg( p_access, "Writing all full segments" );
 
-    block_t *output = p_sys->full_segments;
+    vlc_frame_t *output = p_sys->full_segments;
     vlc_tick_t output_last_length;
     if( *p_sys->full_segments_end )
         output_last_length = (*p_sys->full_segments_end)->i_length;
@@ -963,7 +962,7 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
         {
             if( p_sys->stuffing_size )
             {
-                output = block_Realloc( output, p_sys->stuffing_size, output->i_buffer );
+                output = vlc_frame_Realloc( output, p_sys->stuffing_size, output->i_buffer );
                 if( unlikely(!output ) )
                     return VLC_ENOMEM;
                 memcpy( output->p_buffer, p_sys->stuffing_bytes, p_sys->stuffing_size );
@@ -1003,8 +1002,8 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
 
         if ( (size_t)val >= output->i_buffer )
         {
-           block_t *p_next = output->p_next;
-           block_Release (output);
+           vlc_frame_t *p_next = output->p_next;
+           vlc_frame_Release (output);
            output = p_next;
            crypted=false;
         }
@@ -1021,19 +1020,19 @@ static ssize_t writeSegment( sout_access_out_t *p_access )
 /*****************************************************************************
  * Write: standard write on a file descriptor.
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     size_t i_write = 0;
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     while( p_buffer )
     {
-        /* Check if current block is already past segment-length
-            and we want to write gathered blocks into segment
+        /* Check if current frame is already past segment-length
+            and we want to write gathered frames into segment
             and update playlist */
-        if( p_sys->ongoing_segment && ( p_sys->b_splitanywhere  || ( p_buffer->i_flags & BLOCK_FLAG_HEADER ) ) )
+        if( p_sys->ongoing_segment && ( p_sys->b_splitanywhere  || ( p_buffer->i_flags & FRAME_FLAG_HEADER ) ) )
         {
             msg_Dbg( p_access, "Moving ongoing segment to full segments-queue" );
-            block_ChainLastAppend( &p_sys->full_segments_end, p_sys->ongoing_segment );
+            vlc_frame_ChainLastAppend( &p_sys->full_segments_end, p_sys->ongoing_segment );
             p_sys->ongoing_segment = NULL;
             p_sys->ongoing_segment_end = &p_sys->ongoing_segment;
             p_sys->b_segment_has_data = true;
@@ -1047,9 +1046,9 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         }
         i_write += ret;
 
-        block_t *p_temp = p_buffer->p_next;
+        vlc_frame_t *p_temp = p_buffer->p_next;
         p_buffer->p_next = NULL;
-        block_ChainLastAppend( &p_sys->ongoing_segment_end, p_buffer );
+        vlc_frame_ChainLastAppend( &p_sys->ongoing_segment_end, p_buffer );
         p_buffer = p_temp;
     }
 
diff --git a/modules/access_output/rist.c b/modules/access_output/rist.c
index 3f2f3901bd..cd55500e54 100644
--- a/modules/access_output/rist.c
+++ b/modules/access_output/rist.c
@@ -27,11 +27,11 @@
 #endif
 
 #include <vlc_common.h>
+#include <vlc_data.h>
 #include <vlc_interrupt.h>
 #include <vlc_fs.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 #include <vlc_network.h>
 #include <vlc_threads.h>
 #include <vlc_rand.h>
@@ -89,10 +89,10 @@ typedef struct
     bool         b_ismulticast;
     vlc_mutex_t  lock;
     vlc_mutex_t  fd_lock;
-    block_t      *p_pktbuffer;
+    vlc_frame_t      *p_pktbuffer;
     uint64_t     i_ticks_caching;
     uint32_t     ssrc;
-    block_fifo_t *p_fifo;
+    vlc_frame_fifo_t *p_fifo;
     /* stats variables */
     uint64_t     i_last_stat;
     uint32_t     i_retransmit_packets;
@@ -183,14 +183,14 @@ static void rist_retransmit(sout_access_out_t *p_access, struct rist_flow *flow,
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     struct rtp_pkt *pkt = &(flow->buffer[seq]);
-    if (pkt->buffer == NULL)
+    if (pkt->buffer.frame == NULL)
     {
         msg_Err(p_access, "RIST recovery: missing requested packet %d, buffer not yet full", seq);
         return;
     }
 
     /* Mark SSID for retransmission (change the last bit of the ssrc to 1) */
-    pkt->buffer->p_buffer[11] |= (1 << 0);
+    pkt->buffer.frame->p_buffer[11] |= (1 << 0);
 #ifdef TEST_PACKET_LOSS
 #   warning COMPILED WITH SELF INFLICTED PACKET LOSS
         if ((flow->packets_count % 14) == 0) {
@@ -210,8 +210,8 @@ static void rist_retransmit(sout_access_out_t *p_access, struct rist_flow *flow,
             seq, age, flow->wi);
         p_sys->i_retransmit_packets++;
         vlc_mutex_lock( &p_sys->fd_lock );
-        if (rist_Write(flow->fd_out, pkt->buffer->p_buffer, pkt->buffer->i_buffer) 
-                != (ssize_t)pkt->buffer->i_buffer) {
+        if (rist_Write(flow->fd_out, pkt->buffer.frame->p_buffer, pkt->buffer.frame->i_buffer) 
+                != (ssize_t)pkt->buffer.frame->i_buffer) {
             msg_Err(p_access, "Error sending retransmitted packet after 2 tries ...");
         }
 
@@ -494,9 +494,9 @@ static void* ThreadSend( void *data )
         ssize_t len = 0;
         uint16_t seq = 0;
         uint32_t pkt_ts = 0;
-        block_t *out = block_FifoGet( p_sys->p_fifo );
+        vlc_frame_t *out = vlc_frame_FifoGet( p_sys->p_fifo );
 
-        block_cleanup_push( out );
+        vlc_frame_cleanup_push( out );
         vlc_tick_wait (out->i_dts + i_caching);
         vlc_cleanup_pop();
 
@@ -530,13 +530,13 @@ static void* ThreadSend( void *data )
         /* Always replace the existing one with the new one */
         struct rtp_pkt *pkt;
         pkt = &(flow->buffer[seq]);
-        if (pkt->buffer)
+        if (pkt->buffer.frame)
         {
-            block_Release(pkt->buffer);
-            pkt->buffer = NULL;
+            vlc_frame_Release(pkt->buffer.frame);
+            pkt->buffer.frame = NULL;
         }
         pkt->rtp_ts = pkt_ts;
-        pkt->buffer = out;
+        pkt->buffer.frame = out;
 
         if (flow->reset == 1)
         {
@@ -577,7 +577,7 @@ static void* ThreadSend( void *data )
     return NULL;
 }
 
-static void SendtoFIFO( sout_access_out_t *p_access, block_t *buffer )
+static void SendtoFIFO( sout_access_out_t *p_access, vlc_frame_t *buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     uint16_t seq = p_sys->rtp_counter++;
@@ -591,18 +591,18 @@ static void SendtoFIFO( sout_access_out_t *p_access, block_t *buffer )
     uint32_t pkt_ts = rtp_get_ts(buffer->i_dts);
     rtp_set_timestamp(bufhdr, pkt_ts);
 
-    block_t *pkt = block_Duplicate(buffer);
-    block_FifoPut( p_sys->p_fifo, pkt );
+    vlc_frame_t *pkt = vlc_frame_Duplicate(buffer);
+    vlc_frame_FifoPut( p_sys->p_fifo, pkt );
 }
 
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     int i_len = 0;
 
     while( p_buffer )
     {
-        block_t *p_next;
+        vlc_frame_t *p_next;
         int i_block_split = 0;
 
         if( !p_sys->b_mtu_warning && p_buffer->i_buffer > p_sys->i_packet_size )
@@ -653,13 +653,13 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         }
 
         p_next = p_buffer->p_next;
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
         p_buffer = p_next;
 
     }
 
     if ( i_len <= 0 ) {
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
     }
     return i_len;
 }
@@ -689,7 +689,7 @@ static void Clean( sout_access_out_t *p_access )
     sout_access_out_sys_t *p_sys = p_access->p_sys;
 
     if( likely(p_sys->p_fifo != NULL) )
-        block_FifoRelease( p_sys->p_fifo );
+        vlc_frame_FifoRelease( p_sys->p_fifo );
 
     if ( p_sys->flow )
     {
@@ -704,10 +704,10 @@ static void Clean( sout_access_out_t *p_access )
         }
         for (int i=0; i<RIST_QUEUE_SIZE; i++) {
             struct rtp_pkt *pkt = &(p_sys->flow->buffer[i]);
-            if (pkt->buffer)
+            if (pkt->buffer.frame)
             {
-                block_Release(pkt->buffer);
-                pkt->buffer = NULL;
+                vlc_frame_Release(pkt->buffer.frame);
+                pkt->buffer.frame = NULL;
             }
         }
         free(p_sys->flow->buffer);
@@ -717,7 +717,7 @@ static void Clean( sout_access_out_t *p_access )
     vlc_mutex_destroy( &p_sys->lock );
     vlc_mutex_destroy( &p_sys->fd_lock );
     if (p_sys->p_pktbuffer)
-        block_Release(p_sys->p_pktbuffer);
+        vlc_frame_Release(p_sys->p_pktbuffer);
 }
 
 static void Close( vlc_object_t * p_this )
@@ -796,10 +796,10 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_ticks_caching = VLC_TICK_FROM_MS(var_InheritInteger( p_access, 
         SOUT_CFG_PREFIX "caching"));
     p_sys->i_packet_size = var_InheritInteger(p_access, SOUT_CFG_PREFIX "packet-size" );
-    p_sys->p_fifo = block_FifoNew();
+    p_sys->p_fifo = vlc_frame_FifoNew();
     if( unlikely(p_sys->p_fifo == NULL) )
         goto failed;
-    p_sys->p_pktbuffer = block_Alloc( p_sys->i_packet_size );
+    p_sys->p_pktbuffer = vlc_frame_Alloc( p_sys->i_packet_size );
     if( unlikely(p_sys->p_pktbuffer == NULL) )
         goto failed;
 
diff --git a/modules/access_output/shout.c b/modules/access_output/shout.c
index 4f55b8e9c2..2592135f17 100644
--- a/modules/access_output/shout.c
+++ b/modules/access_output/shout.c
@@ -47,7 +47,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 #include <vlc_url.h>
 
 #include <shout/shout.h>
@@ -148,7 +147,7 @@ static const char *const ppsz_sout_options[] = {
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *, block_t * );
+static ssize_t Write( sout_access_out_t *, vlc_frame_t * );
 static int Control( sout_access_out_t *, int, va_list );
 
 typedef struct
@@ -432,7 +431,7 @@ static int Control( sout_access_out_t *p_access, int i_query, va_list args )
 /*****************************************************************************
  * Write: standard write
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     size_t i_write = 0;
@@ -440,7 +439,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
     shout_sync( p_sys->p_shout );
     while( p_buffer )
     {
-        block_t *p_next = p_buffer->p_next;
+        vlc_frame_t *p_next = p_buffer->p_next;
 
         if( shout_send( p_sys->p_shout, p_buffer->p_buffer, p_buffer->i_buffer )
              == SHOUTERR_SUCCESS )
@@ -467,12 +466,12 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
             else
             {
                 msg_Err( p_access, "failed to reconnect to server" );
-                block_ChainRelease( p_buffer );
+                vlc_frame_ChainRelease( p_buffer );
                 return VLC_EGENERIC;
             }
 
         }
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
 
         /* XXX: Unsure if that's the cause for some audio trouble... */
 
diff --git a/modules/access_output/srt.c b/modules/access_output/srt.c
index da55a30478..a0e47febe8 100644
--- a/modules/access_output/srt.c
+++ b/modules/access_output/srt.c
@@ -28,7 +28,6 @@
 #include <vlc_fs.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 #include <vlc_network.h>
 
 typedef struct
@@ -211,7 +210,7 @@ out:
     return !failed;
 }
 
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     int i_len = 0;
@@ -223,7 +222,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 
     while( p_buffer )
     {
-        block_t *p_next;
+        vlc_frame_t *p_next;
 
         i_len += p_buffer->i_buffer;
 
@@ -268,7 +267,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
                 }
 
                 /* if 'srt_epoll_wait' is interrupted, we still need to
-                *  finish sending current block or it may be sent only
+                *  finish sending current frame or it may be sent only
                 *  partially. TODO: this delay can be prevented,
                 *  possibly with a FIFO and an additional thread.
                 */
@@ -310,7 +309,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         }
 
         p_next = p_buffer->p_next;
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
         p_buffer = p_next;
 
         if ( b_interrupted )
@@ -332,7 +331,7 @@ out:
     }
     vlc_mutex_unlock( &p_sys->lock );
 
-    if ( i_len <= 0 ) block_ChainRelease( p_buffer );
+    if ( i_len <= 0 ) vlc_frame_ChainRelease( p_buffer );
     return i_len;
 }
 
diff --git a/modules/access_output/udp.c b/modules/access_output/udp.c
index 6fe59bbbaa..c127f5c5f6 100644
--- a/modules/access_output/udp.c
+++ b/modules/access_output/udp.c
@@ -37,7 +37,6 @@
 #include <errno.h>
 
 #include <vlc_sout.h>
-#include <vlc_block.h>
 
 #ifdef _WIN32
 #   include <winsock2.h>
@@ -102,7 +101,7 @@ static const char *const ppsz_core_options[] = {
     NULL
 };
 
-static ssize_t Write   ( sout_access_out_t *, block_t * );
+static ssize_t Write   ( sout_access_out_t *, vlc_frame_t * );
 static int Control( sout_access_out_t *, int, va_list );
 
 static void* ThreadWrite( void * );
@@ -114,8 +113,8 @@ typedef struct
     bool          b_mtu_warning;
     size_t        i_mtu;
 
-    block_fifo_t *p_fifo;
-    block_t      *p_buffer;
+    vlc_frame_fifo_t *p_fifo;
+    vlc_frame_t      *p_buffer;
 
     vlc_thread_t  thread;
 } sout_access_out_sys_t;
@@ -206,14 +205,14 @@ static int Open( vlc_object_t *p_this )
     p_sys->i_handle = i_handle;
     p_sys->i_mtu = var_CreateGetInteger( p_this, "mtu" );
     p_sys->b_mtu_warning = false;
-    p_sys->p_fifo = block_FifoNew();
+    p_sys->p_fifo = vlc_frame_FifoNew();
     p_sys->p_buffer = NULL;
 
     if( vlc_clone( &p_sys->thread, ThreadWrite, p_access,
                            VLC_THREAD_PRIORITY_HIGHEST ) )
     {
         msg_Err( p_access, "cannot spawn sout access thread" );
-        block_FifoRelease( p_sys->p_fifo );
+        vlc_frame_FifoRelease( p_sys->p_fifo );
         net_Close (i_handle);
         free (p_sys);
         return VLC_EGENERIC;
@@ -235,9 +234,9 @@ static void Close( vlc_object_t * p_this )
 
     vlc_cancel( p_sys->thread );
     vlc_join( p_sys->thread, NULL );
-    block_FifoRelease( p_sys->p_fifo );
+    vlc_frame_FifoRelease( p_sys->p_fifo );
 
-    if( p_sys->p_buffer ) block_Release( p_sys->p_buffer );
+    if( p_sys->p_buffer ) vlc_frame_Release( p_sys->p_buffer );
 
     net_Close( p_sys->i_handle );
     free( p_sys );
@@ -262,14 +261,14 @@ static int Control( sout_access_out_t *p_access, int i_query, va_list args )
 /*****************************************************************************
  * Write: standard write on a file descriptor.
  *****************************************************************************/
-static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, vlc_frame_t *p_buffer )
 {
     sout_access_out_sys_t *p_sys = p_access->p_sys;
     int i_len = 0;
 
     while( p_buffer )
     {
-        block_t *p_next;
+        vlc_frame_t *p_next;
         int i_packets = 0;
         vlc_tick_t now = vlc_tick_now();
 
@@ -290,7 +289,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
                          now - p_sys->p_buffer->i_dts
                           - p_sys->i_caching );
             }
-            block_FifoPut( p_sys->p_fifo, p_sys->p_buffer );
+            vlc_frame_FifoPut( p_sys->p_fifo, p_sys->p_buffer );
             p_sys->p_buffer = NULL;
         }
 
@@ -304,7 +303,7 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
 
             if( !p_sys->p_buffer )
             {
-                p_sys->p_buffer = block_Alloc( p_sys->i_mtu );
+                p_sys->p_buffer = vlc_frame_Alloc( p_sys->i_mtu );
                 if( !p_sys->p_buffer ) break;
                 p_sys->p_buffer->i_dts = p_buffer->i_dts;
                 p_sys->p_buffer->i_buffer = 0;
@@ -316,11 +315,11 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
             p_sys->p_buffer->i_buffer += i_write;
             p_buffer->p_buffer += i_write;
             p_buffer->i_buffer -= i_write;
-            if ( p_buffer->i_flags & BLOCK_FLAG_CLOCK )
+            if ( p_buffer->i_flags & FRAME_FLAG_CLOCK )
             {
-                if ( p_sys->p_buffer->i_flags & BLOCK_FLAG_CLOCK )
+                if ( p_sys->p_buffer->i_flags & FRAME_FLAG_CLOCK )
                     msg_Warn( p_access, "putting two PCRs at once" );
-                p_sys->p_buffer->i_flags |= BLOCK_FLAG_CLOCK;
+                p_sys->p_buffer->i_flags |= FRAME_FLAG_CLOCK;
             }
 
             if( p_sys->p_buffer->i_buffer == p_sys->i_mtu || i_packets > 1 )
@@ -332,13 +331,13 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
                              vlc_tick_now() - p_sys->p_buffer->i_dts
                               - p_sys->i_caching );
                 }
-                block_FifoPut( p_sys->p_fifo, p_sys->p_buffer );
+                vlc_frame_FifoPut( p_sys->p_fifo, p_sys->p_buffer );
                 p_sys->p_buffer = NULL;
             }
         }
 
         p_next = p_buffer->p_next;
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
         p_buffer = p_next;
     }
 
@@ -360,7 +359,7 @@ static void* ThreadWrite( void *data )
 
     for (;;)
     {
-        block_t *p_pk = block_FifoGet( p_sys->p_fifo );
+        vlc_frame_t *p_pk = vlc_frame_FifoGet( p_sys->p_fifo );
         vlc_tick_t    i_date;
 
         i_date = p_sys->i_caching + p_pk->i_dts;
@@ -372,7 +371,7 @@ static void* ThreadWrite( void *data )
                     msg_Dbg( p_access, "mmh, hole (%"PRId64" > 2s) -> drop",
                              i_date - i_date_last );
 
-                block_Release( p_pk );
+                vlc_frame_Release( p_pk );
 
                 i_date_last = i_date;
                 i_dropped_packets++;
@@ -386,9 +385,9 @@ static void* ThreadWrite( void *data )
             }
         }
 
-        block_cleanup_push( p_pk );
+        vlc_frame_cleanup_push( p_pk );
         i_to_send--;
-        if( !i_to_send || (p_pk->i_flags & BLOCK_FLAG_CLOCK) )
+        if( !i_to_send || (p_pk->i_flags & FRAME_FLAG_CLOCK) )
         {
             vlc_tick_wait( i_date );
             i_to_send = i_group;
@@ -414,7 +413,7 @@ static void* ThreadWrite( void *data )
         }
 #endif
 
-        block_Release( p_pk );
+        vlc_frame_Release( p_pk );
 
     }
     return NULL;
diff --git a/modules/mux/asf.c b/modules/mux/asf.c
index 2a82cbbb59..93324b372a 100644
--- a/modules/mux/asf.c
+++ b/modules/mux/asf.c
@@ -34,7 +34,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_codecs.h>
 #include <vlc_arrays.h>
 #include <vlc_rand.h>
@@ -144,7 +144,7 @@ typedef struct
 
     bool            b_write_header;
 
-    block_t         *pk;
+    vlc_frame_t         *pk;
     int             i_pk_used;
     int             i_pk_frame;
     vlc_tick_t      i_pk_dts;
@@ -160,10 +160,10 @@ typedef struct
     char            *psz_rating;
 } sout_mux_sys_t;
 
-static block_t *asf_header_create( sout_mux_t *, bool );
-static block_t *asf_packet_create( sout_mux_t *, asf_track_t *, block_t * );
-static block_t *asf_stream_end_create( sout_mux_t *);
-static block_t *asf_packet_flush( sout_mux_t * );
+static vlc_frame_t *asf_header_create( sout_mux_t *, bool );
+static vlc_frame_t *asf_packet_create( sout_mux_t *, asf_track_t *, vlc_frame_t * );
+static vlc_frame_t *asf_stream_end_create( sout_mux_t *);
+static vlc_frame_t *asf_packet_flush( sout_mux_t * );
 
 typedef struct
 {
@@ -253,7 +253,7 @@ static void Close( vlc_object_t * p_this )
 {
     sout_mux_t     *p_mux = (sout_mux_t*)p_this;
     sout_mux_sys_t *p_sys = p_mux->p_sys;
-    block_t  *out;
+    vlc_frame_t  *out;
 
     msg_Dbg( p_mux, "Asf muxer closed" );
 
@@ -680,9 +680,9 @@ static int Mux( sout_mux_t *p_mux )
 
     if( p_sys->b_write_header )
     {
-        block_t *out = asf_header_create( p_mux, true );
+        vlc_frame_t *out = asf_header_create( p_mux, true );
 
-        out->i_flags |= BLOCK_FLAG_HEADER;
+        out->i_flags |= FRAME_FLAG_HEADER;
         sout_AccessOutWrite( p_mux->p_access, out );
 
         p_sys->b_write_header = false;
@@ -693,8 +693,8 @@ static int Mux( sout_mux_t *p_mux )
         sout_input_t  *p_input;
         asf_track_t   *tk;
         vlc_tick_t    i_dts;
-        block_t *data;
-        block_t *pk;
+        vlc_frame_t *data;
+        vlc_frame_t *pk;
 
         int i_stream = sout_MuxGetStream( p_mux, 1, &i_dts );
         if( i_stream < 0 )
@@ -715,7 +715,7 @@ static int Mux( sout_mux_t *p_mux )
         p_input = p_mux->pp_inputs[i_stream];
         tk      = (asf_track_t*)p_input->p_sys;
 
-        data = block_FifoGet( p_input->p_fifo );
+        data = vlc_frame_FifoGet( p_input->p_fifo );
 
         /* Convert VC1 to ASF special format */
         if( tk->i_fourcc == VLC_FOURCC( 'W', 'V', 'C', '1' ) )
@@ -840,13 +840,13 @@ static void asf_chunk_add( bo_t *bo,
     bo_addle_u16( bo, i_len + 8 );
 }
 
-static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
+static vlc_frame_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     vlc_tick_t i_duration = 0;
     int i_size, i_header_ext_size;
     int i_ci_size, i_cm_size = 0, i_cd_size = 0;
-    block_t *out;
+    vlc_frame_t *out;
     bo_t bo;
 
     msg_Dbg( p_mux, "Asf muxer creating header" );
@@ -908,13 +908,13 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
 
     if( p_sys->b_asf_http )
     {
-        out = block_Alloc( i_size + 50 + 12 );
+        out = vlc_frame_Alloc( i_size + 50 + 12 );
         bo_init( &bo, out->p_buffer, i_size + 50 + 12 );
         asf_chunk_add( &bo, 0x4824, i_size + 50, 0xc00, p_sys->i_seq++ );
     }
     else
     {
-        out = block_Alloc( i_size + 50 );
+        out = vlc_frame_Alloc( i_size + 50 );
         bo_init( &bo, out->p_buffer, i_size + 50 );
     }
 
@@ -1130,11 +1130,11 @@ static block_t *asf_header_create( sout_mux_t *p_mux, bool b_broadcast )
 /****************************************************************************
  *
  ****************************************************************************/
-static block_t *asf_packet_flush( sout_mux_t *p_mux )
+static vlc_frame_t *asf_packet_flush( sout_mux_t *p_mux )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     int i_pad, i_preheader = p_sys->b_asf_http ? 12 : 0;
-    block_t *pk;
+    vlc_frame_t *pk;
     bo_t bo;
 
     if( !p_sys->pk ) return 0;
@@ -1165,15 +1165,15 @@ static block_t *asf_packet_flush( sout_mux_t *p_mux )
     return pk;
 }
 
-static block_t *asf_packet_create( sout_mux_t *p_mux,
-                                   asf_track_t *tk, block_t *data )
+static vlc_frame_t *asf_packet_create( sout_mux_t *p_mux,
+                                   asf_track_t *tk, vlc_frame_t *data )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
 
     int     i_data = data->i_buffer;
     int     i_pos  = 0;
     uint8_t *p_data= data->p_buffer;
-    block_t *first = NULL, **last = &first;
+    vlc_frame_t *first = NULL, **last = &first;
     int     i_preheader = p_sys->b_asf_http ? 12 : 0;
 
     while( i_pos < i_data )
@@ -1183,7 +1183,7 @@ static block_t *asf_packet_create( sout_mux_t *p_mux,
 
         if( p_sys->pk == NULL )
         {
-            p_sys->pk = block_Alloc( p_sys->i_packet_size + i_preheader );
+            p_sys->pk = vlc_frame_Alloc( p_sys->i_packet_size + i_preheader );
             /* reserve 14 bytes for the packet header */
             p_sys->i_pk_used = 14 + i_preheader;
             p_sys->i_pk_frame = 0;
@@ -1205,8 +1205,8 @@ static block_t *asf_packet_create( sout_mux_t *p_mux,
             continue;
         }
 
-        bo_add_u8   ( &bo, !(data->i_flags & BLOCK_FLAG_TYPE_P ||
-                      data->i_flags & BLOCK_FLAG_TYPE_B) ?
+        bo_add_u8   ( &bo, !(data->i_flags & FRAME_FLAG_TYPE_P ||
+                      data->i_flags & FRAME_FLAG_TYPE_B) ?
                       0x80 | tk->i_id : tk->i_id );
         bo_add_u8   ( &bo, tk->i_sequence );
         bo_addle_u32( &bo, i_pos );
@@ -1230,28 +1230,28 @@ static block_t *asf_packet_create( sout_mux_t *p_mux,
     }
 
     tk->i_sequence++;
-    block_Release( data );
+    vlc_frame_Release( data );
 
     return first;
 }
 
-static block_t *asf_stream_end_create( sout_mux_t *p_mux )
+static vlc_frame_t *asf_stream_end_create( sout_mux_t *p_mux )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
 
-    block_t *out = NULL;
+    vlc_frame_t *out = NULL;
     bo_t bo;
 
     if( p_sys->b_asf_http )
     {
-        out = block_Alloc( 12 );
+        out = vlc_frame_Alloc( 12 );
         bo_init( &bo, out->p_buffer, 12 );
         asf_chunk_add( &bo, 0x4524, 0, 0x00, p_sys->i_seq++ );
     }
     else
     {
         /* Create index */
-        out = block_Alloc( 56 );
+        out = vlc_frame_Alloc( 56 );
         bo_init( &bo, out->p_buffer, 56 );
         bo_add_guid ( &bo, &asf_object_index_guid );
         bo_addle_u64( &bo, 56 );
diff --git a/modules/mux/av1_pack.h b/modules/mux/av1_pack.h
index d594b862c7..a9609b963a 100644
--- a/modules/mux/av1_pack.h
+++ b/modules/mux/av1_pack.h
@@ -21,7 +21,7 @@
 #define VLC_AV1_PACK_H
 
 #include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 #include "../packetizer/av1_obu.h"
 
@@ -33,10 +33,10 @@
     https://github.com/Matroska-Org/matroska-specification/blob/master/codec/av1.md
 */
 
-static inline block_t *AV1_Pack_Sample(block_t *p_block)
+static inline vlc_frame_t *AV1_Pack_Sample(vlc_frame_t *p_frame)
 {
     AV1_OBU_iterator_ctx_t ctx;
-    AV1_OBU_iterator_init(&ctx, p_block->p_buffer, p_block->i_buffer);
+    AV1_OBU_iterator_init(&ctx, p_frame->p_buffer, p_frame->i_buffer);
     const uint8_t *p_obu = NULL; size_t i_obu;
     while(AV1_OBU_iterate_next(&ctx, &p_obu, &i_obu))
     {
@@ -48,20 +48,20 @@ static inline block_t *AV1_Pack_Sample(block_t *p_block)
             case AV1_OBU_REDUNDANT_FRAME_HEADER:
             case AV1_OBU_TILE_LIST:
             {
-                size_t i_offset = p_obu - p_block->p_buffer;
-                if(i_offset < p_block->i_buffer - i_offset - i_obu)
+                size_t i_offset = p_obu - p_frame->p_buffer;
+                if(i_offset < p_frame->i_buffer - i_offset - i_obu)
                 {
-                    memmove(&p_block->p_buffer[i_obu], p_block->p_buffer, i_offset);
-                    p_block->p_buffer += i_obu;
-                    p_block->i_buffer -= i_obu;
+                    memmove(&p_frame->p_buffer[i_obu], p_frame->p_buffer, i_offset);
+                    p_frame->p_buffer += i_obu;
+                    p_frame->i_buffer -= i_obu;
                 }
                 else
                 {
-                    memmove(&p_block->p_buffer[i_offset], &p_obu[i_obu], i_obu);
-                    p_block->i_buffer -= i_obu;
+                    memmove(&p_frame->p_buffer[i_offset], &p_obu[i_obu], i_obu);
+                    p_frame->i_buffer -= i_obu;
                 }
-                AV1_OBU_iterator_init(&ctx, p_block->p_buffer,
-                                            p_block->i_buffer);
+                AV1_OBU_iterator_init(&ctx, p_frame->p_buffer,
+                                            p_frame->i_buffer);
                 p_obu = NULL;
             } break;
             default:
@@ -71,26 +71,26 @@ static inline block_t *AV1_Pack_Sample(block_t *p_block)
 
     if(p_obu && AV1_OBUHasSizeField(p_obu))
     {
-        const size_t i_offset = p_obu - p_block->p_buffer;
+        const size_t i_offset = p_obu - p_frame->p_buffer;
         const uint8_t i_header = AV1_OBUHasExtensionField(p_obu) ? 2 : 1;
         uint8_t i_len = 0;
-        (void) AV1_OBUSize(p_obu, p_block->i_buffer - i_offset, &i_len);
+        (void) AV1_OBUSize(p_obu, p_frame->i_buffer - i_offset, &i_len);
         if(i_len)
         {
-            memmove(&p_block->p_buffer[i_offset + i_header],
-                    &p_block->p_buffer[i_offset + i_header + i_len],
-                    p_block->i_buffer - i_offset - i_header - i_len);
-            p_block->p_buffer[i_offset] &= 0xFD;
-            p_block->i_buffer -= i_len;
+            memmove(&p_frame->p_buffer[i_offset + i_header],
+                    &p_frame->p_buffer[i_offset + i_header + i_len],
+                    p_frame->i_buffer - i_offset - i_header - i_len);
+            p_frame->p_buffer[i_offset] &= 0xFD;
+            p_frame->i_buffer -= i_len;
         }
     }
 
-    if(!p_block->i_buffer)
+    if(!p_frame->i_buffer)
     {
-        block_Release(p_block);
+        vlc_frame_Release(p_frame);
         return NULL;
     }
-    return p_block;
+    return p_frame;
 }
 
 #endif
diff --git a/modules/mux/avi.c b/modules/mux/avi.c
index b545954aa1..aebca7794f 100644
--- a/modules/mux/avi.c
+++ b/modules/mux/avi.c
@@ -33,7 +33,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_codecs.h>
 #include <vlc_boxes.h>
 #include "../demux/avi/bitmapinfoheader.h"
@@ -150,8 +150,8 @@ typedef struct
 #define AVIIF_KEYFRAME      0x00000010L /* this frame is a key frame.*/
 
 
-static block_t *avi_HeaderCreateRIFF( sout_mux_t * );
-static block_t *avi_HeaderCreateidx1( sout_mux_t * );
+static vlc_frame_t *avi_HeaderCreateRIFF( sout_mux_t * );
+static vlc_frame_t *avi_HeaderCreateidx1( sout_mux_t * );
 
 static void SetFCC( uint8_t *p, char *fcc )
 {
@@ -204,7 +204,7 @@ static void Close( vlc_object_t * p_this )
     sout_mux_t      *p_mux = (sout_mux_t*)p_this;
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
 
-    block_t       *p_hdr, *p_idx1;
+    vlc_frame_t       *p_hdr, *p_idx1;
     int                 i_stream;
 
     msg_Dbg( p_mux, "AVI muxer closed" );
@@ -458,7 +458,7 @@ static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
 
 static int PrepareSamples( const avi_stream_t *p_stream,
                            const es_format_t *p_fmt,
-                           block_t **pp_block )
+                           vlc_frame_t **pp_frame )
 {
     if( p_stream->i_frames == 0 && p_stream->i_cat == VIDEO_ES )
     {
@@ -468,11 +468,11 @@ static int PrepareSamples( const avi_stream_t *p_stream,
        {
            size_t i_header_length =
                p_stream->p_bih->biSize - sizeof(VLC_BITMAPINFOHEADER);
-           *pp_block = block_Realloc( *pp_block, i_header_length,
-                                      (*pp_block)->i_buffer );
-           if( !*pp_block )
+           *pp_frame = vlc_frame_Realloc( *pp_frame, i_header_length,
+                                      (*pp_frame)->i_buffer );
+           if( !*pp_frame )
                return VLC_ENOMEM;
-           memcpy((*pp_block)->p_buffer,&p_stream->p_bih[1], i_header_length);
+           memcpy((*pp_frame)->p_buffer,&p_stream->p_bih[1], i_header_length);
        }
     }
 
@@ -487,8 +487,8 @@ static int PrepareSamples( const avi_stream_t *p_stream,
         unsigned gshift = ctz(p_fmt->video.i_gmask);
         unsigned bshift = ctz(p_fmt->video.i_bmask);
 
-        uint8_t *p_data = (*pp_block)->p_buffer;
-        for( size_t i=0; i<(*pp_block)->i_buffer / 3; i++ )
+        uint8_t *p_data = (*pp_frame)->p_buffer;
+        for( size_t i=0; i<(*pp_frame)->i_buffer / 3; i++ )
         {
             uint8_t *p = &p_data[i*3];
             /* reorder as BGR using shift value (done by FixRGB) */
@@ -512,7 +512,7 @@ static int Mux      ( sout_mux_t *p_mux )
     {
         msg_Dbg( p_mux, "writing header" );
 
-        block_t *p_hdr = avi_HeaderCreateRIFF( p_mux );
+        vlc_frame_t *p_hdr = avi_HeaderCreateRIFF( p_mux );
         if ( !p_hdr )
             return VLC_EGENERIC;
         sout_AccessOutWrite( p_mux->p_access, p_hdr );
@@ -523,7 +523,7 @@ static int Mux      ( sout_mux_t *p_mux )
     for( i = 0; i < p_mux->i_nb_inputs; i++ )
     {
         int i_count;
-        block_fifo_t *p_fifo;
+        vlc_frame_fifo_t *p_fifo;
 
         if (!p_mux->pp_inputs[i]->p_sys)
             continue;
@@ -532,16 +532,16 @@ static int Mux      ( sout_mux_t *p_mux )
         p_stream = &p_sys->stream[i_stream];
 
         p_fifo = p_mux->pp_inputs[i]->p_fifo;
-        i_count = block_FifoCount(  p_fifo );
+        i_count = vlc_frame_FifoCount(  p_fifo );
         while( i_count > 1 )
         {
             avi_idx1_entry_t *p_idx;
-            block_t *p_data;
+            vlc_frame_t *p_data;
 
-            p_data = block_FifoGet( p_fifo );
-            if( block_FifoCount( p_fifo ) > 0 )
+            p_data = vlc_frame_FifoGet( p_fifo );
+            if( vlc_frame_FifoCount( p_fifo ) > 0 )
             {
-                block_t *p_next = block_FifoShow( p_fifo );
+                vlc_frame_t *p_next = vlc_frame_FifoShow( p_fifo );
                 p_data->i_length = p_next->i_dts - p_data->i_dts;
             }
 
@@ -556,7 +556,7 @@ static int Mux      ( sout_mux_t *p_mux )
             if( p_data->i_length < 0 )
             {
                 msg_Warn( p_mux, "argg length < 0 l" );
-                block_Release( p_data );
+                vlc_frame_Release( p_data );
                 i_count--;
                 continue;
             }
@@ -567,7 +567,7 @@ static int Mux      ( sout_mux_t *p_mux )
             p_idx = &p_sys->idx1.entry[p_sys->idx1.i_entry_count];
             memcpy( p_idx->fcc, p_stream->fcc, 4 );
             p_idx->i_flags = 0;
-            if( ( p_data->i_flags & BLOCK_FLAG_TYPE_MASK ) == 0 || ( p_data->i_flags & BLOCK_FLAG_TYPE_I ) )
+            if( ( p_data->i_flags & FRAME_FLAG_TYPE_MASK ) == 0 || ( p_data->i_flags & FRAME_FLAG_TYPE_I ) )
                 p_idx->i_flags = AVIIF_KEYFRAME;
             p_idx->i_pos   = p_sys->i_movi_size + 4;
             p_idx->i_length= p_data->i_buffer;
@@ -579,7 +579,7 @@ static int Mux      ( sout_mux_t *p_mux )
                        p_sys->idx1.i_entry_max * sizeof( avi_idx1_entry_t ) );
             }
 
-            p_data = block_Realloc( p_data, 8, p_data->i_buffer );
+            p_data = vlc_frame_Realloc( p_data, 8, p_data->i_buffer );
             if( p_data )
             {
                 SetFCC( p_data->p_buffer, p_stream->fcc );
@@ -587,7 +587,7 @@ static int Mux      ( sout_mux_t *p_mux )
 
                 if( p_data->i_buffer & 0x01 )
                 {
-                    p_data = block_Realloc( p_data, 0, p_data->i_buffer + 1 );
+                    p_data = vlc_frame_Realloc( p_data, 0, p_data->i_buffer + 1 );
                     if ( p_data )
                         p_data->p_buffer[ p_data->i_buffer - 1 ] = '\0';
                 }
@@ -865,7 +865,7 @@ static int avi_HeaderAdd_INFO( sout_mux_t *p_mux, bo_t *p_bo )
     AVI_BOX_EXIT( 0 );
 }
 
-static block_t *avi_HeaderCreateRIFF( sout_mux_t *p_mux )
+static vlc_frame_t *avi_HeaderCreateRIFF( sout_mux_t *p_mux )
 {
     sout_mux_sys_t      *p_sys = p_mux->p_sys;
     int                 i_stream;
@@ -931,7 +931,7 @@ static block_t *avi_HeaderCreateRIFF( sout_mux_t *p_mux )
     return( bo.b );
 }
 
-static block_t * avi_HeaderCreateidx1( sout_mux_t *p_mux )
+static vlc_frame_t * avi_HeaderCreateidx1( sout_mux_t *p_mux )
 {
     sout_mux_sys_t      *p_sys = p_mux->p_sys;
     uint32_t            i_idx1_size;
diff --git a/modules/mux/dummy.c b/modules/mux/dummy.c
index da33350db9..6e4731bec4 100644
--- a/modules/mux/dummy.c
+++ b/modules/mux/dummy.c
@@ -32,7 +32,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -144,29 +143,29 @@ static int Mux( sout_mux_t *p_mux )
 
     for( i = 0; i < p_mux->i_nb_inputs; i++ )
     {
-        block_fifo_t *p_fifo;
+        vlc_frame_fifo_t *p_fifo;
         int i_count;
 
         if( p_sys->b_header && p_mux->pp_inputs[i]->p_fmt->i_extra )
         {
             /* Write header data */
-            block_t *p_data;
-            p_data = block_Alloc( p_mux->pp_inputs[i]->p_fmt->i_extra );
+            vlc_frame_t *p_data;
+            p_data = vlc_frame_Alloc( p_mux->pp_inputs[i]->p_fmt->i_extra );
 
             memcpy( p_data->p_buffer, p_mux->pp_inputs[i]->p_fmt->p_extra,
                     p_mux->pp_inputs[i]->p_fmt->i_extra );
 
-            p_data->i_flags |= BLOCK_FLAG_HEADER;
+            p_data->i_flags |= FRAME_FLAG_HEADER;
 
             msg_Dbg( p_mux, "writing header data" );
             sout_AccessOutWrite( p_mux->p_access, p_data );
         }
 
         p_fifo = p_mux->pp_inputs[i]->p_fifo;
-        i_count = block_FifoCount( p_fifo );
+        i_count = vlc_frame_FifoCount( p_fifo );
         while( i_count > 0 )
         {
-            block_t *p_data = block_FifoGet( p_fifo );
+            vlc_frame_t *p_data = vlc_frame_FifoGet( p_fifo );
 
             sout_AccessOutWrite( p_mux->p_access, p_data );
 
diff --git a/modules/mux/mp4/libmp4mux.c b/modules/mux/mp4/libmp4mux.c
index f99a346336..ce0d7cfda9 100644
--- a/modules/mux/mp4/libmp4mux.c
+++ b/modules/mux/mp4/libmp4mux.c
@@ -408,7 +408,7 @@ void box_gather (bo_t *box, bo_t *box2)
     {
         box_fix(box2, bo_size( box2 ));
         size_t i_offset = bo_size( box );
-        box->b = block_Realloc(box->b, 0, box->b->i_buffer + box2->b->i_buffer);
+        box->b = vlc_frame_Realloc(box->b, 0, box->b->i_buffer + box2->b->i_buffer);
         if(likely(box->b))
             memcpy(&box->b->p_buffer[i_offset], box2->b->p_buffer, box2->b->i_buffer);
     }
@@ -1570,7 +1570,7 @@ static bo_t *GetStblBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
                     continue;
             }
 
-            if (p_track->samples[i].i_flags & BLOCK_FLAG_TYPE_I) {
+            if (p_track->samples[i].i_flags & FRAME_FLAG_TYPE_I) {
                 if (stss == NULL) {
                     stss = box_full_new("stss", 0, 0);
                     if(!stss)
diff --git a/modules/mux/mp4/mp4.c b/modules/mux/mp4/mp4.c
index 1874f30801..b5b148623d 100644
--- a/modules/mux/mp4/mp4.c
+++ b/modules/mux/mp4/mp4.c
@@ -31,7 +31,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 #include <assert.h>
 #include <time.h>
@@ -105,7 +105,7 @@ typedef struct mp4_fragentry_t mp4_fragentry_t;
 
 struct mp4_fragentry_t
 {
-    block_t  *p_block;
+    vlc_frame_t  *p_frame;
     uint32_t  i_run;
     mp4_fragentry_t *p_next;
 };
@@ -184,20 +184,20 @@ static void mp4_stream_Delete(mp4_stream_t *p_stream)
     /* mp4 frag */
     if (p_stream->p_held_entry)
     {
-        block_Release(p_stream->p_held_entry->p_block);
+        vlc_frame_Release(p_stream->p_held_entry->p_frame);
         free(p_stream->p_held_entry);
     }
     while(p_stream->read.p_first)
     {
         mp4_fragentry_t *p_next = p_stream->read.p_first->p_next;
-        block_Release(p_stream->read.p_first->p_block);
+        vlc_frame_Release(p_stream->read.p_first->p_frame);
         free(p_stream->read.p_first);
         p_stream->read.p_first = p_next;
     }
     while(p_stream->towrite.p_first)
     {
         mp4_fragentry_t *p_next = p_stream->towrite.p_first->p_next;
-        block_Release(p_stream->towrite.p_first->p_block);
+        vlc_frame_Release(p_stream->towrite.p_first->p_frame);
         free(p_stream->towrite.p_first);
         p_stream->towrite.p_first = p_next;
     }
@@ -220,7 +220,7 @@ static mp4_stream_t *mp4_stream_New(void)
 
 static void box_send(sout_mux_t *p_mux,  bo_t *box);
 
-static block_t *ConvertSUBT(block_t *);
+static vlc_frame_t *ConvertSUBT(vlc_frame_t *);
 static bool CreateCurrentEdit(mp4_stream_t *, vlc_tick_t, bool);
 static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_stream);
 
@@ -390,7 +390,7 @@ static void Close(vlc_object_t *p_this)
         while (i_mdatsize > 0)
         {
             size_t i_chunk = __MIN(32768, i_mdatsize);
-            block_t *p_buf = block_Alloc(i_chunk);
+            vlc_frame_t *p_buf = vlc_frame_Alloc(i_chunk);
             sout_AccessOutSeek(p_mux->p_access,
                                 p_sys->i_mdat_pos + i_mdatsize - i_chunk);
             ssize_t i_read = sout_AccessOutRead(p_mux->p_access, p_buf);
@@ -398,7 +398,7 @@ static void Close(vlc_object_t *p_this)
                 msg_Warn(p_this, "read() not supported by access output, "
                           "won't create a fast start file");
                 p_sys->b_fast_start = false;
-                block_Release(p_buf);
+                vlc_frame_Release(p_buf);
                 break;
             }
             sout_AccessOutSeek(p_mux->p_access, p_sys->i_mdat_pos + i_mdatsize +
@@ -545,7 +545,7 @@ static void DelStream(sout_mux_t *p_mux, sout_input_t *p_input)
 
     if(!mp4mux_Is(p_sys->muxh, FRAGMENTED))
     {
-        while(block_FifoCount(p_input->p_fifo) > 0 &&
+        while(vlc_frame_FifoCount(p_input->p_fifo) > 0 &&
               MuxStream(p_mux, p_input, p_stream) == VLC_SUCCESS) {};
 
         if(CreateCurrentEdit(p_stream, p_sys->i_start_dts, false))
@@ -601,17 +601,17 @@ static bool CreateCurrentEdit(mp4_stream_t *p_stream, vlc_tick_t i_mux_start_dts
     return mp4mux_track_AddEdit(p_stream->tinfo, &newedit);
 }
 
-static block_t * BlockDequeue(sout_input_t *p_input, mp4_stream_t *p_stream)
+static vlc_frame_t * FrameDequeue(sout_input_t *p_input, mp4_stream_t *p_stream)
 {
-    block_t *p_block = block_FifoGet(p_input->p_fifo);
-    if(unlikely(!p_block))
+    vlc_frame_t *p_frame = vlc_frame_FifoGet(p_input->p_fifo);
+    if(unlikely(!p_frame))
         return NULL;
 
     /* Create on the fly extradata as packetizer is not in the loop */
     if(p_stream->extrabuilder && !mp4mux_track_HasSamplePriv(p_stream->tinfo))
     {
          mux_extradata_builder_Feed(p_stream->extrabuilder,
-                                    p_block->p_buffer, p_block->i_buffer);
+                                    p_frame->p_buffer, p_frame->i_buffer);
          const uint8_t *p_extra;
          size_t i_extra = mux_extradata_builder_Get(p_stream->extrabuilder, &p_extra);
          if(i_extra)
@@ -621,23 +621,23 @@ static block_t * BlockDequeue(sout_input_t *p_input, mp4_stream_t *p_stream)
     switch(mp4mux_track_GetFmt(p_stream->tinfo)->i_codec)
     {
         case VLC_CODEC_AV1:
-            p_block = AV1_Pack_Sample(p_block);
+            p_frame = AV1_Pack_Sample(p_frame);
             break;
         case VLC_CODEC_H264:
         case VLC_CODEC_HEVC:
-            p_block = hxxx_AnnexB_to_xVC(p_block, 4);
+            p_frame = hxxx_AnnexB_to_xVC(p_frame, 4);
             break;
         case VLC_CODEC_SUBT:
-            p_block = ConvertSUBT(p_block);
+            p_frame = ConvertSUBT(p_frame);
             break;
         default:
             break;
     }
 
-    return p_block;
+    return p_frame;
 }
 
-static inline vlc_tick_t dts_fb_pts( const block_t *p_data )
+static inline vlc_tick_t dts_fb_pts( const vlc_frame_t *p_data )
 {
     return p_data->i_dts != VLC_TICK_INVALID ? p_data->i_dts: p_data->i_pts;
 }
@@ -646,12 +646,12 @@ static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_s
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
 
-    block_t *p_data = BlockDequeue(p_input, p_stream);
+    vlc_frame_t *p_data = FrameDequeue(p_input, p_stream);
     if(!p_data)
         return VLC_SUCCESS;
 
     /* Reset reference dts in case of discontinuity (ex: gather sout) */
-    if (p_data->i_flags & BLOCK_FLAG_DISCONTINUITY &&
+    if (p_data->i_flags & FRAME_FLAG_DISCONTINUITY &&
         mp4mux_track_GetLastSample(p_stream->tinfo) != NULL)
     {
         if(p_stream->i_first_dts != VLC_TICK_INVALID)
@@ -659,7 +659,7 @@ static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_s
             if(!CreateCurrentEdit(p_stream, p_sys->i_start_dts,
                                   mp4mux_Is(p_sys->muxh, FRAGMENTED)))
             {
-                block_Release( p_data );
+                vlc_frame_Release( p_data );
                 return VLC_ENOMEM;
             }
         }
@@ -681,17 +681,17 @@ static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_s
     if (mp4mux_track_GetFmt(p_stream->tinfo)->i_cat != SPU_ES)
     {
         /* Fix length of the sample */
-        if (block_FifoCount(p_input->p_fifo) > 0)
+        if (vlc_frame_FifoCount(p_input->p_fifo) > 0)
         {
-            block_t *p_next = block_FifoShow(p_input->p_fifo);
-            if ( p_next->i_flags & BLOCK_FLAG_DISCONTINUITY )
+            vlc_frame_t *p_next = vlc_frame_FifoShow(p_input->p_fifo);
+            if ( p_next->i_flags & FRAME_FLAG_DISCONTINUITY )
             { /* we have no way to know real length except by decoding */
                 if ( mp4mux_track_GetFmt(p_stream->tinfo)->i_cat == VIDEO_ES )
                 {
                     p_data->i_length = vlc_tick_from_samples(
                             mp4mux_track_GetFmt(p_stream->tinfo)->video.i_frame_rate_base,
                             mp4mux_track_GetFmt(p_stream->tinfo)->video.i_frame_rate );
-                    if( p_data->i_flags & BLOCK_FLAG_SINGLE_FIELD )
+                    if( p_data->i_flags & FRAME_FLAG_SINGLE_FIELD )
                         p_data->i_length >>= 1;
                     msg_Dbg( p_mux, "video track %u fixup to %"PRId64" for sample %u",
                              mp4mux_track_GetID(p_stream->tinfo), p_data->i_length,
@@ -780,12 +780,12 @@ static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_s
     /* Add SPU clearing tag (duration tb fixed on next SPU or stream end )*/
     if ( mp4mux_track_GetFmt(p_stream->tinfo)->i_cat == SPU_ES && sample.i_length > 0 )
     {
-        block_t *p_empty = NULL;
+        vlc_frame_t *p_empty = NULL;
         if(mp4mux_track_GetFmt(p_stream->tinfo)->i_codec == VLC_CODEC_SUBT||
            mp4mux_track_GetFmt(p_stream->tinfo)->i_codec == VLC_CODEC_QTXT||
            mp4mux_track_GetFmt(p_stream->tinfo)->i_codec == VLC_CODEC_TX3G)
         {
-            p_empty = block_Alloc(3);
+            p_empty = vlc_frame_Alloc(3);
             if(p_empty)
             {
                 /* Write a " " */
@@ -796,13 +796,13 @@ static int MuxStream(sout_mux_t *p_mux, sout_input_t *p_input, mp4_stream_t *p_s
         }
         else if(mp4mux_track_GetFmt(p_stream->tinfo)->i_codec == VLC_CODEC_TTML)
         {
-            p_empty = block_Alloc(40);
+            p_empty = vlc_frame_Alloc(40);
             if(p_empty)
                 memcpy(p_empty->p_buffer, "<tt><body><div><p></p></div></body></tt>", 40);
         }
         else if(mp4mux_track_GetFmt(p_stream->tinfo)->i_codec == VLC_CODEC_WEBVTT)
         {
-            p_empty = block_Alloc(8);
+            p_empty = vlc_frame_Alloc(8);
             if(p_empty)
                 memcpy(p_empty->p_buffer, "\x00\x00\x00\x08vtte", 8);
         }
@@ -867,19 +867,19 @@ static int Mux(sout_mux_t *p_mux)
 /*****************************************************************************
  *
  *****************************************************************************/
-static block_t *ConvertSUBT(block_t *p_block)
+static vlc_frame_t *ConvertSUBT(vlc_frame_t *p_frame)
 {
-    p_block = block_Realloc(p_block, 2, p_block->i_buffer);
-    if( !p_block )
+    p_frame = vlc_frame_Realloc(p_frame, 2, p_frame->i_buffer);
+    if( !p_frame )
         return NULL;
     /* No trailling '\0' */
-    if (p_block->i_buffer > 2 && p_block->p_buffer[p_block->i_buffer-1] == '\0')
-        p_block->i_buffer--;
+    if (p_frame->i_buffer > 2 && p_frame->p_buffer[p_frame->i_buffer-1] == '\0')
+        p_frame->i_buffer--;
 
-    p_block->p_buffer[0] = ((p_block->i_buffer - 2) >> 8)&0xff;
-    p_block->p_buffer[1] = ((p_block->i_buffer - 2)     )&0xff;
+    p_frame->p_buffer[0] = ((p_frame->i_buffer - 2) >> 8)&0xff;
+    p_frame->p_buffer[1] = ((p_frame->i_buffer - 2)     )&0xff;
 
-    return p_block;
+    return p_frame;
 }
 
 static void box_send(sout_mux_t *p_mux,  bo_t *box)
@@ -996,8 +996,8 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
             while (p_entry && (b_allsamelength || b_allsamesize))
             {
                 /* compare against queue head */
-                b_allsamelength &= ( p_entry->p_block->i_length == p_stream->read.p_first->p_block->i_length );
-                b_allsamesize &= ( p_entry->p_block->i_buffer == p_stream->read.p_first->p_block->i_buffer );
+                b_allsamelength &= ( p_entry->p_frame->i_length == p_stream->read.p_first->p_frame->i_length );
+                b_allsamesize &= ( p_entry->p_frame->i_buffer == p_stream->read.p_first->p_frame->i_buffer );
                 p_entry = p_entry->p_next;
             }
         }
@@ -1007,16 +1007,16 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
         {
             /* Current segment have all same duration value, different than trex's default */
             if (b_allsamelength &&
-                p_stream->read.p_first->p_block->i_length !=
+                p_stream->read.p_first->p_frame->i_length !=
                     mp4mux_track_GetDefaultSampleDuration(p_stream->tinfo) &&
-                p_stream->read.p_first->p_block->i_length)
+                p_stream->read.p_first->p_frame->i_length)
                     i_tfhd_flags |= MP4_TFHD_DFLT_SAMPLE_DURATION;
 
             /* Current segment have all same size value, different than trex's default */
             if (b_allsamesize &&
-                p_stream->read.p_first->p_block->i_buffer !=
+                p_stream->read.p_first->p_frame->i_buffer !=
                     mp4mux_track_GetDefaultSampleSize(p_stream->tinfo) &&
-                p_stream->read.p_first->p_block->i_buffer)
+                p_stream->read.p_first->p_frame->i_buffer)
                     i_tfhd_flags |= MP4_TFHD_DFLT_SAMPLE_SIZE;
         }
         else
@@ -1036,12 +1036,12 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
 
         /* set the local sample duration default */
         if (i_tfhd_flags & MP4_TFHD_DFLT_SAMPLE_DURATION)
-            bo_add_32be(tfhd, samples_from_vlc_tick(p_stream->read.p_first->p_block->i_length,
+            bo_add_32be(tfhd, samples_from_vlc_tick(p_stream->read.p_first->p_frame->i_length,
                                                     mp4mux_track_GetTimescale(p_stream->tinfo)));
 
         /* set the local sample size default */
         if (i_tfhd_flags & MP4_TFHD_DFLT_SAMPLE_SIZE)
-            bo_add_32be(tfhd, p_stream->read.p_first->p_block->i_buffer);
+            bo_add_32be(tfhd, p_stream->read.p_first->p_frame->i_buffer);
 
         box_gather(traf, tfhd);
 
@@ -1061,7 +1061,7 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
         {
             uint32_t i_trun_flags = 0x0;
 
-            if (p_stream->b_hasiframes && !(p_stream->read.p_first->p_block->i_flags & BLOCK_FLAG_TYPE_I))
+            if (p_stream->b_hasiframes && !(p_stream->read.p_first->p_frame->i_flags & FRAME_FLAG_TYPE_I))
                 i_trun_flags |= MP4_TRUN_FIRST_FLAGS;
 
             if (!b_allsamelength ||
@@ -1093,10 +1093,10 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
             mp4_fragentry_t *p_entry = p_stream->read.p_first;
             while(p_entry)
             {
-                if ( i_barrier_time && i_run_time + p_entry->p_block->i_length > i_barrier_time )
+                if ( i_barrier_time && i_run_time + p_entry->p_frame->i_length > i_barrier_time )
                     break;
                 i_entry_count++;
-                i_run_time += p_entry->p_block->i_length;
+                i_run_time += p_entry->p_frame->i_length;
                 p_entry = p_entry->p_next;
             }
             bo_add_32be(trun, i_entry_count); // sample count
@@ -1115,38 +1115,38 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
                 DEQUEUE_ENTRY(p_stream->read, p_entry);
 
                 if (i_trun_flags & MP4_TRUN_SAMPLE_DURATION)
-                    bo_add_32be(trun, samples_from_vlc_tick(p_entry->p_block->i_length,
+                    bo_add_32be(trun, samples_from_vlc_tick(p_entry->p_frame->i_length,
                                                             mp4mux_track_GetTimescale(p_stream->tinfo))); // sample duration
 
                 if (i_trun_flags & MP4_TRUN_SAMPLE_SIZE)
-                    bo_add_32be(trun, p_entry->p_block->i_buffer); // sample size
+                    bo_add_32be(trun, p_entry->p_frame->i_buffer); // sample size
 
                 if (i_trun_flags & MP4_TRUN_SAMPLE_TIME_OFFSET)
                 {
                     vlc_tick_t i_diff = 0;
-                    if ( p_entry->p_block->i_dts  != VLC_TICK_INVALID &&
-                         p_entry->p_block->i_pts > p_entry->p_block->i_dts )
+                    if ( p_entry->p_frame->i_dts  != VLC_TICK_INVALID &&
+                         p_entry->p_frame->i_pts > p_entry->p_frame->i_dts )
                     {
-                        i_diff = p_entry->p_block->i_pts - p_entry->p_block->i_dts;
+                        i_diff = p_entry->p_frame->i_pts - p_entry->p_frame->i_dts;
                     }
                     bo_add_32be(trun, samples_from_vlc_tick(i_diff, mp4mux_track_GetTimescale(p_stream->tinfo))); // ctts
                 }
 
-                *pi_mdat_total_size += p_entry->p_block->i_buffer;
+                *pi_mdat_total_size += p_entry->p_frame->i_buffer;
 
                 ENQUEUE_ENTRY(p_stream->towrite, p_entry);
                 i_entry_count--;
                 i_sample++;
 
                 /* Add keyframe entry if needed */
-                if (p_stream->b_hasiframes && (p_entry->p_block->i_flags & BLOCK_FLAG_TYPE_I) &&
+                if (p_stream->b_hasiframes && (p_entry->p_frame->i_flags & FRAME_FLAG_TYPE_I) &&
                     (mp4mux_track_GetFmt(p_stream->tinfo)->i_cat == VIDEO_ES ||
                      mp4mux_track_GetFmt(p_stream->tinfo)->i_cat == AUDIO_ES))
                 {
                     AddKeyframeEntry(p_stream, i_write_pos, i_trak, i_sample, i_time);
                 }
 
-                i_time += p_entry->p_block->i_length;
+                i_time += p_entry->p_frame->i_length;
             }
 
             box_gather(traf, trun);
@@ -1171,7 +1171,7 @@ static bo_t *GetMoofBox(sout_mux_t *p_mux, size_t *pi_mdat_total_size,
     }
 
     /* set iframe flag, so the streaming server always starts from moof */
-    moof->b->i_flags |= BLOCK_FLAG_TYPE_I;
+    moof->b->i_flags |= FRAME_FLAG_TYPE_I;
 
     return moof;
 }
@@ -1199,11 +1199,11 @@ static void WriteFragmentMDAT(sout_mux_t *p_mux, size_t i_total_size)
         while(p_stream->towrite.p_first)
         {
             mp4_fragentry_t *p_entry = p_stream->towrite.p_first;
-            p_sys->i_pos += p_entry->p_block->i_buffer;
-            p_stream->i_written_duration += p_entry->p_block->i_length;
+            p_sys->i_pos += p_entry->p_frame->i_buffer;
+            p_stream->i_written_duration += p_entry->p_frame->i_length;
 
-            p_entry->p_block->i_flags &= ~BLOCK_FLAG_TYPE_I; // clear flag for http stream
-            sout_AccessOutWrite(p_mux->p_access, p_entry->p_block);
+            p_entry->p_frame->i_flags &= ~FRAME_FLAG_TYPE_I; // clear flag for http stream
+            sout_AccessOutWrite(p_mux->p_access, p_entry->p_frame);
 
             p_stream->towrite.p_first = p_entry->p_next;
             free(p_entry);
@@ -1266,11 +1266,11 @@ static void FlushHeader(sout_mux_t *p_mux)
 
     bo_t *moov = mp4mux_GetMoov(p_sys->muxh, VLC_OBJECT(p_mux), 0);
 
-    /* merge into a single block */
+    /* merge into a single frame */
     box_gather(ftyp, moov);
 
     /* add header flag for streaming server */
-    ftyp->b->i_flags |= BLOCK_FLAG_HEADER;
+    ftyp->b->i_flags |= FRAME_FLAG_HEADER;
     p_sys->i_pos += bo_size(ftyp);
     box_send(p_mux, ftyp);
     p_sys->b_header_sent = true;
@@ -1320,7 +1320,7 @@ static void WriteFragments(sout_mux_t *p_mux, bool b_flush)
 
     if (moof && i_mdat_size == 0)
     {
-        block_Release(moof->b);
+        vlc_frame_Release(moof->b);
         FREENULL(moof);
     }
 
@@ -1328,7 +1328,7 @@ static void WriteFragments(sout_mux_t *p_mux, bool b_flush)
     {
         msg_Dbg(p_mux, "writing moof @ %"PRId64, p_sys->i_pos);
         p_sys->i_pos += bo_size(moof);
-        assert(moof->b->i_flags & BLOCK_FLAG_TYPE_I); /* http sout */
+        assert(moof->b->i_flags & FRAME_FLAG_TYPE_I); /* http sout */
         box_send(p_mux, moof);
         msg_Dbg(p_mux, "writing mdat @ %"PRId64, p_sys->i_pos);
         WriteFragmentMDAT(p_mux, i_mdat_size);
@@ -1344,7 +1344,7 @@ static void WriteFragments(sout_mux_t *p_mux, bool b_flush)
 
 /* Do an entry length fixup using only its own info.
  * This is the end boundary case. */
-static void LengthLocalFixup(sout_mux_t *p_mux, const mp4_stream_t *p_stream, block_t *p_entrydata)
+static void LengthLocalFixup(sout_mux_t *p_mux, const mp4_stream_t *p_stream, vlc_frame_t *p_entrydata)
 {
     if ( mp4mux_track_GetFmt(p_stream->tinfo)->i_cat == VIDEO_ES &&
          mp4mux_track_GetFmt(p_stream->tinfo)->video.i_frame_rate )
@@ -1386,8 +1386,8 @@ static void CloseFrag(vlc_object_t *p_this)
         mp4_stream_t *p_stream = p_sys->pp_streams[i];
         if (p_stream->p_held_entry)
         {
-            if (p_stream->p_held_entry->p_block->i_length < 1)
-                LengthLocalFixup(p_mux, p_stream, p_stream->p_held_entry->p_block);
+            if (p_stream->p_held_entry->p_frame->i_length < 1)
+                LengthLocalFixup(p_mux, p_stream, p_stream->p_held_entry->p_frame);
             ENQUEUE_ENTRY(p_stream->read, p_stream->p_held_entry);
             p_stream->p_held_entry = NULL;
         }
@@ -1434,40 +1434,40 @@ static int MuxFrag(sout_mux_t *p_mux)
 
     sout_input_t *p_input  = p_mux->pp_inputs[i_stream];
     mp4_stream_t *p_stream = (mp4_stream_t*) p_input->p_sys;
-    block_t *p_currentblock = BlockDequeue(p_input, p_stream);
-    if( !p_currentblock )
+    vlc_frame_t *p_currentframe = FrameDequeue(p_input, p_stream);
+    if( !p_currentframe )
         return VLC_SUCCESS;
 
     /* Set time ranges */
     if( p_stream->i_first_dts == VLC_TICK_INVALID )
     {
-        p_stream->i_first_dts = p_currentblock->i_dts;
+        p_stream->i_first_dts = p_currentframe->i_dts;
         if( p_sys->i_start_dts == VLC_TICK_INVALID )
-            p_sys->i_start_dts = p_currentblock->i_dts;
+            p_sys->i_start_dts = p_currentframe->i_dts;
     }
 
     /* If we have a previous entry for outgoing queue */
     if (p_stream->p_held_entry)
     {
-        block_t *p_heldblock = p_stream->p_held_entry->p_block;
+        vlc_frame_t *p_heldframe = p_stream->p_held_entry->p_frame;
 
-        /* Fix previous block length from current */
-        if (p_heldblock->i_length < 1)
+        /* Fix previous frame length from current */
+        if (p_heldframe->i_length < 1)
         {
 
             /* Fix using dts if not on a boundary */
-            if ((p_currentblock->i_flags & BLOCK_FLAG_DISCONTINUITY) == 0)
-                p_heldblock->i_length = p_currentblock->i_dts - p_heldblock->i_dts;
+            if ((p_currentframe->i_flags & FRAME_FLAG_DISCONTINUITY) == 0)
+                p_heldframe->i_length = p_currentframe->i_dts - p_heldframe->i_dts;
 
-            if (p_heldblock->i_length < 1)
-                LengthLocalFixup(p_mux, p_stream, p_heldblock);
+            if (p_heldframe->i_length < 1)
+                LengthLocalFixup(p_mux, p_stream, p_heldframe);
         }
 
         /* enqueue */
         ENQUEUE_ENTRY(p_stream->read, p_stream->p_held_entry);
         p_stream->p_held_entry = NULL;
 
-        if (p_stream->b_hasiframes && (p_heldblock->i_flags & BLOCK_FLAG_TYPE_I) &&
+        if (p_stream->b_hasiframes && (p_heldframe->i_flags & FRAME_FLAG_TYPE_I) &&
             mp4mux_track_GetDuration(p_stream->tinfo) - p_sys->i_written_duration < FRAGMENT_LENGTH)
         {
             /* Flag the last iframe time, we'll use it as boundary so it will start
@@ -1478,7 +1478,7 @@ static int MuxFrag(sout_mux_t *p_mux)
         /* update buffered time */
         mp4mux_track_ForceDuration(p_stream->tinfo,
                                  mp4mux_track_GetDuration(p_stream->tinfo) +
-                                 __MAX(0, p_heldblock->i_length));
+                                 __MAX(0, p_heldframe->i_length));
     }
 
 
@@ -1487,18 +1487,18 @@ static int MuxFrag(sout_mux_t *p_mux)
     if (unlikely(!p_stream->p_held_entry))
         return VLC_ENOMEM;
 
-    p_stream->p_held_entry->p_block  = p_currentblock;
+    p_stream->p_held_entry->p_frame  = p_currentframe;
     p_stream->p_held_entry->i_run    = p_stream->i_current_run;
     p_stream->p_held_entry->p_next   = NULL;
 
     if (mp4mux_track_GetFmt(p_stream->tinfo)->i_cat == VIDEO_ES )
     {
-        if (!p_stream->b_hasiframes && (p_currentblock->i_flags & BLOCK_FLAG_TYPE_I))
+        if (!p_stream->b_hasiframes && (p_currentframe->i_flags & FRAME_FLAG_TYPE_I))
             p_stream->b_hasiframes = true;
 
         if (!mp4mux_track_HasBFrames(p_stream->tinfo) &&
-            p_currentblock->i_dts != VLC_TICK_INVALID &&
-            p_currentblock->i_pts > p_currentblock->i_dts)
+            p_currentframe->i_dts != VLC_TICK_INVALID &&
+            p_currentframe->i_pts > p_currentframe->i_dts)
                 mp4mux_track_SetHasBFrames(p_stream->tinfo);
     }
 
diff --git a/modules/mux/mpeg/pes.c b/modules/mux/mpeg/pes.c
index 98c05add41..4b8cede52e 100644
--- a/modules/mux/mpeg/pes.c
+++ b/modules/mux/mpeg/pes.c
@@ -31,7 +31,7 @@
 
 #include <vlc_common.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <assert.h>
 
 #include "pes.h"
@@ -289,7 +289,7 @@ static inline int PESHeader( uint8_t *p_hdr, int64_t i_pts, int64_t i_dts,
     }
 }
 
-/** EStoPES, encapsulate an elementary stream block into PES packet(s)
+/** EStoPES, encapsulate an elementary stream frame into PES packet(s)
  * each with a maximal payload size of @i_max_pes_size at .
  *
  * In some circumstances, unbounded PES packets are allowed:
@@ -317,13 +317,13 @@ static inline int PESHeader( uint8_t *p_hdr, int64_t i_pts, int64_t i_dts,
  *                       To allow unbounded PES packets in transport stream
  *                       VIDEO_ES, set to INT_MAX.
  */
-void EStoPES ( block_t **pp_pes,
+void EStoPES ( vlc_frame_t **pp_pes,
                    const es_format_t *p_fmt, int i_stream_id,
                    int b_mpeg2, int b_data_alignment, int i_header_size,
                    int i_max_pes_size, vlc_tick_t ts_offset )
 {
-    block_t *p_es = *pp_pes;
-    block_t *p_pes = NULL;
+    vlc_frame_t *p_es = *pp_pes;
+    vlc_frame_t *p_pes = NULL;
 
     uint8_t *p_data;
     int     i_size;
@@ -347,11 +347,11 @@ void EStoPES ( block_t **pp_pes,
     if( ( p_fmt->i_codec == VLC_CODEC_MP4V ||
           p_fmt->i_codec == VLC_CODEC_H264 ||
           p_fmt->i_codec == VLC_CODEC_HEVC) &&
-        p_es->i_flags & BLOCK_FLAG_TYPE_I )
+        p_es->i_flags & FRAME_FLAG_TYPE_I )
     {
         /* For MPEG4 video, add VOL before I-frames,
            for H264 add SPS/PPS before keyframes*/
-        p_es = block_Realloc( p_es, p_fmt->i_extra, p_es->i_buffer );
+        p_es = vlc_frame_Realloc( p_es, p_fmt->i_extra, p_es->i_buffer );
 
         memcpy( p_es->p_buffer, p_fmt->p_extra, p_fmt->i_extra );
     }
@@ -372,7 +372,7 @@ void EStoPES ( block_t **pp_pes,
             ((p_es->p_buffer[offset] & 0x1f) != 9) ) /* Not AUD */
         {
             /* Make similar AUD as libavformat does */
-            p_es = block_Realloc( p_es, 6, p_es->i_buffer );
+            p_es = vlc_frame_Realloc( p_es, 6, p_es->i_buffer );
             p_es->p_buffer[0] = 0x00;
             p_es->p_buffer[1] = 0x00;
             p_es->p_buffer[2] = 0x00;
@@ -404,7 +404,7 @@ void EStoPES ( block_t **pp_pes,
 
         if( p_es )
         {
-            p_es = block_Realloc( p_es, i_pes_header, p_es->i_buffer );
+            p_es = vlc_frame_Realloc( p_es, i_pes_header, p_es->i_buffer );
             p_data = p_es->p_buffer+i_pes_header;
             /* reuse p_es for first frame */
             *pp_pes = p_pes = p_es;
@@ -413,7 +413,7 @@ void EStoPES ( block_t **pp_pes,
         }
         else
         {
-            p_pes->p_next = block_Alloc( i_pes_header + i_pes_payload );
+            p_pes->p_next = vlc_frame_Alloc( i_pes_header + i_pes_payload );
             p_pes = p_pes->p_next;
 
             p_pes->i_dts    = 0;
@@ -438,14 +438,14 @@ void EStoPES ( block_t **pp_pes,
 
     /* Now redate all pes */
     p_pes = *pp_pes;
-    vlc_tick_t i_block_dts = p_pes->i_dts;
+    vlc_tick_t i_frame_dts = p_pes->i_dts;
     vlc_tick_t i_length = p_pes->i_length / i_pes_count;
     while( p_pes )
     {
-        p_pes->i_dts = i_block_dts;
+        p_pes->i_dts = i_frame_dts;
         p_pes->i_length = i_length;
 
-        i_block_dts += i_length;
+        i_frame_dts += i_length;
         p_pes = p_pes->p_next;
     }
 }
diff --git a/modules/mux/mpeg/pes.h b/modules/mux/mpeg/pes.h
index 7115efb5ec..207dafa86c 100644
--- a/modules/mux/mpeg/pes.h
+++ b/modules/mux/mpeg/pes.h
@@ -34,7 +34,7 @@
 
 #define PES_PAYLOAD_SIZE_MAX 65500
 
-void EStoPES ( block_t **pp_pes,
+void EStoPES ( vlc_frame_t **pp_pes,
                    const es_format_t *p_fmt, int i_stream_id,
                    int b_mpeg2, int b_data_alignment, int i_header_size,
                    int i_max_pes_size, vlc_tick_t ts_offset );
diff --git a/modules/mux/mpeg/ps.c b/modules/mux/mpeg/ps.c
index 1bb700a1a0..7e0dc642dd 100644
--- a/modules/mux/mpeg/ps.c
+++ b/modules/mux/mpeg/ps.c
@@ -34,7 +34,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 #include "bits.h"
 #include "pes.h"
@@ -88,9 +88,9 @@ static int Mux      ( sout_mux_t * );
  * Local prototypes
  *****************************************************************************/
 
-static void MuxWritePackHeader  ( sout_mux_t *, block_t **, vlc_tick_t );
-static void MuxWriteSystemHeader( sout_mux_t *, block_t **, vlc_tick_t );
-static void MuxWritePSM         ( sout_mux_t *, block_t **, vlc_tick_t );
+static void MuxWritePackHeader  ( sout_mux_t *, vlc_frame_t **, vlc_tick_t );
+static void MuxWriteSystemHeader( sout_mux_t *, vlc_frame_t **, vlc_tick_t );
+static void MuxWritePSM         ( sout_mux_t *, vlc_frame_t **, vlc_tick_t );
 
 static void StreamIdInit        ( bool *id, int i_range );
 static int  StreamIdGet         ( bool *id, int i_id_min, int i_id_max );
@@ -212,11 +212,11 @@ static void Close( vlc_object_t * p_this )
     sout_mux_t      *p_mux = (sout_mux_t*)p_this;
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
 
-    block_t   *p_end;
+    vlc_frame_t   *p_end;
 
     msg_Info( p_mux, "Close" );
 
-    p_end = block_Alloc( 4 );
+    p_end = vlc_frame_Alloc( 4 );
     if( p_end )
     {
         p_end->p_buffer[0] = 0x00; p_end->p_buffer[1] = 0x00;
@@ -459,7 +459,7 @@ static int Mux( sout_mux_t *p_mux )
         sout_input_t *p_input;
         ps_stream_t *p_stream;
 
-        block_t *p_ps, *p_data;
+        vlc_frame_t *p_ps, *p_data;
 
         vlc_tick_t     i_dts;
 
@@ -516,14 +516,14 @@ static int Mux( sout_mux_t *p_mux )
         /* Write regulary SystemHeader */
         if( p_sys->i_pes_count % 300 == 0 )
         {
-            block_t *p_pk;
+            vlc_frame_t *p_pk;
 
             MuxWriteSystemHeader( p_mux, &p_ps, i_dts );
 
             /* For MPEG1 streaming, set HEADER flag */
             for( p_pk = p_ps; p_pk != NULL; p_pk = p_pk->p_next )
             {
-                p_pk->i_flags |= BLOCK_FLAG_HEADER;
+                p_pk->i_flags |= FRAME_FLAG_HEADER;
             }
         }
 
@@ -534,11 +534,11 @@ static int Mux( sout_mux_t *p_mux )
         }
 
         /* Get and mux a packet */
-        p_data = block_FifoGet( p_input->p_fifo );
+        p_data = vlc_frame_FifoGet( p_input->p_fifo );
         EStoPES ( &p_data, p_input->p_fmt, p_stream->i_stream_id,
                        p_sys->b_mpeg2, 0, 0, p_sys->i_pes_max_size, 0 );
 
-        block_ChainAppend( &p_ps, p_data );
+        vlc_frame_ChainAppend( &p_ps, p_data );
 
         /* Get size of output data so we can calculate the instant bitrate */
         for( p_data = p_ps; p_data; p_data = p_data->p_next )
@@ -587,18 +587,18 @@ static void StreamIdRelease( bool *id, int i_id_min, int i_id )
     id[i_id - i_id_min] = true;
 }
 
-static void MuxWritePackHeader( sout_mux_t *p_mux, block_t **p_buf,
+static void MuxWritePackHeader( sout_mux_t *p_mux, vlc_frame_t **p_buf,
                                 vlc_tick_t i_dts )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     bits_buffer_t bits;
-    block_t *p_hdr;
+    vlc_frame_t *p_hdr;
     int64_t i_scr;
     int i_mux_rate;
 
     i_scr = TO_SCALE_NZ(i_dts - p_sys->i_dts_delay);
 
-    p_hdr = block_Alloc( 18 );
+    p_hdr = vlc_frame_Alloc( 18 );
     if( !p_hdr )
         return;
     p_hdr->i_pts = p_hdr->i_dts = i_dts;
@@ -642,14 +642,14 @@ static void MuxWritePackHeader( sout_mux_t *p_mux, block_t **p_buf,
 
     p_hdr->i_buffer = p_sys->b_mpeg2 ? 14: 12;
 
-    block_ChainAppend( p_buf, p_hdr );
+    vlc_frame_ChainAppend( p_buf, p_hdr );
 }
 
-static void MuxWriteSystemHeader( sout_mux_t *p_mux, block_t **p_buf,
+static void MuxWriteSystemHeader( sout_mux_t *p_mux, vlc_frame_t **p_buf,
                                   vlc_tick_t i_dts )
 {
     sout_mux_sys_t  *p_sys = p_mux->p_sys;
-    block_t   *p_hdr;
+    vlc_frame_t   *p_hdr;
     bits_buffer_t   bits;
     bool      b_private;
     int i_rate_bound;
@@ -674,7 +674,7 @@ static void MuxWriteSystemHeader( sout_mux_t *p_mux, block_t **p_buf,
     i_nb_stream = p_mux->i_nb_inputs -
         ( i_nb_private > 0 ? i_nb_private - 1 : 0 );
 
-    p_hdr = block_Alloc(  12 + i_nb_stream * 3 );
+    p_hdr = vlc_frame_Alloc(  12 + i_nb_stream * 3 );
     if( !p_hdr )
         return;
     p_hdr->i_dts = p_hdr->i_pts = i_dts;
@@ -745,13 +745,13 @@ static void MuxWriteSystemHeader( sout_mux_t *p_mux, block_t **p_buf,
         }
     }
 
-    block_ChainAppend( p_buf, p_hdr );
+    vlc_frame_ChainAppend( p_buf, p_hdr );
 }
 
-static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, vlc_tick_t i_dts )
+static void MuxWritePSM( sout_mux_t *p_mux, vlc_frame_t **p_buf, vlc_tick_t i_dts )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
-    block_t *p_hdr;
+    vlc_frame_t *p_hdr;
     bits_buffer_t bits;
     int i, i_psm_size = 16, i_es_map_size = 0;
 
@@ -766,7 +766,7 @@ static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, vlc_tick_t i_dts )
 
     i_psm_size += i_es_map_size;
 
-    p_hdr = block_Alloc( i_psm_size );
+    p_hdr = vlc_frame_Alloc( i_psm_size );
     if( !p_hdr )
         return;
     p_hdr->i_dts = p_hdr->i_pts = i_dts;
@@ -822,5 +822,5 @@ static void MuxWritePSM( sout_mux_t *p_mux, block_t **p_buf, vlc_tick_t i_dts )
         bits_write( &bits, 32, i_crc );
     }
 
-    block_ChainAppend( p_buf, p_hdr );
+    vlc_frame_ChainAppend( p_buf, p_hdr );
 }
diff --git a/modules/mux/mpeg/tables.c b/modules/mux/mpeg/tables.c
index 0d0580ed68..ab45496f81 100644
--- a/modules/mux/mpeg/tables.c
+++ b/modules/mux/mpeg/tables.c
@@ -22,7 +22,7 @@
 #endif
 
 #include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_es.h>
 
 # include <dvbpsi/dvbpsi.h>
@@ -47,16 +47,16 @@
 
 #include <assert.h>
 
-block_t *WritePSISection( dvbpsi_psi_section_t* p_section )
+vlc_frame_t *WritePSISection( dvbpsi_psi_section_t* p_section )
 {
-    block_t   *p_psi, *p_first = NULL;
+    vlc_frame_t   *p_psi, *p_first = NULL;
 
     while( p_section )
     {
         int i_size = (uint32_t)(p_section->p_payload_end - p_section->p_data) +
                   (p_section->b_syntax_indicator ? 4 : 0);
 
-        p_psi = block_Alloc( i_size + 1 );
+        p_psi = vlc_frame_Alloc( i_size + 1 );
         if( !p_psi )
             goto error;
         p_psi->i_pts = 0;
@@ -69,7 +69,7 @@ block_t *WritePSISection( dvbpsi_psi_section_t* p_section )
                 p_section->p_data,
                 i_size );
 
-        block_ChainAppend( &p_first, p_psi );
+        vlc_frame_ChainAppend( &p_first, p_psi );
 
         p_section = p_section->p_next;
     }
@@ -78,7 +78,7 @@ block_t *WritePSISection( dvbpsi_psi_section_t* p_section )
 
 error:
     if( p_first )
-        block_ChainRelease( p_first );
+        vlc_frame_ChainRelease( p_first );
     return NULL;
 }
 
@@ -99,10 +99,10 @@ void BuildPAT( dvbpsi_t *p_dvbpsi,
     p_section = dvbpsi_pat_sections_generate( p_dvbpsi, &patpsi, 0 );
     if( likely(p_section) )
     {
-        block_t *p_block = WritePSISection( p_section );
-        if( likely(p_block) )
+        vlc_frame_t *p_frame = WritePSISection( p_section );
+        if( likely(p_frame) )
         {
-            PEStoTS( p_opaque, pf_callback, p_block, p_pat->i_pid,
+            PEStoTS( p_opaque, pf_callback, p_frame, p_pat->i_pid,
                      &p_pat->b_discontinuity, &p_pat->i_continuity_counter );
         }
         dvbpsi_DeletePSISections( p_section );
@@ -676,7 +676,7 @@ void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
         dvbpsi_psi_section_t *sect = dvbpsi_pmt_sections_generate( p_dvbpsi, &dvbpmt[i] );
         if( likely(sect) )
         {
-            block_t *pmt = WritePSISection( sect );
+            vlc_frame_t *pmt = WritePSISection( sect );
             if( likely(pmt) )
             {
                 PEStoTS( p_opaque, pf_callback, pmt, p_pmt[i].i_pid,
@@ -721,7 +721,7 @@ void BuildPMT( dvbpsi_t *p_dvbpsi, vlc_object_t *p_object,
         dvbpsi_psi_section_t *sect = dvbpsi_sdt_sections_generate( p_dvbpsi, &sdtpsi );
         if( likely(sect) )
         {
-            block_t *p_sdtblock = WritePSISection( sect );
+            vlc_frame_t *p_sdtblock = WritePSISection( sect );
             if( likely(p_sdtblock) )
             {
                 PEStoTS( p_opaque, pf_callback, p_sdtblock, p_sdt->ts.i_pid,
diff --git a/modules/mux/mpeg/tables.h b/modules/mux/mpeg/tables.h
index bd988dfe65..ef19874532 100644
--- a/modules/mux/mpeg/tables.h
+++ b/modules/mux/mpeg/tables.h
@@ -33,7 +33,7 @@ typedef struct
     } desc[MAX_SDT_DESC];
 } sdt_psi_t;
 
-block_t * WritePSISection( dvbpsi_psi_section_t* p_section );
+vlc_frame_t * WritePSISection( dvbpsi_psi_section_t* p_section );
 
 void BuildPAT( dvbpsi_t *p_dvbpsi,
                void *p_opaque, PEStoTSCallback pf_callback,
diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index dc94d12038..68a5ef15aa 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -36,7 +36,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_rand.h>
 #include <vlc_charset.h>
 
@@ -194,7 +194,7 @@ static const char *const ts_standards_list_text[] =
   #error "MAX_SDT_DESC < MAX_PMT"
 #endif
 
-#define BLOCK_FLAG_NO_KEYFRAME (1 << BLOCK_FLAG_PRIVATE_SHIFT) /* This is not a key frame for bitrate shaping */
+#define FRAME_FLAG_NO_KEYFRAME (1 << FRAME_FLAG_PRIVATE_SHIFT) /* This is not a key frame for bitrate shaping */
 
 vlc_module_begin ()
     set_description( N_("TS muxer (libdvbpsi)") )
@@ -262,8 +262,8 @@ typedef struct pmt_map_t   /* Holds the mapping between the pmt-pid/pmt table */
 typedef struct
 {
     int     i_depth;
-    block_t *p_first;
-    block_t **pp_last;
+    vlc_frame_t *p_first;
+    vlc_frame_t **pp_last;
 } sout_buffer_chain_t;
 
 static inline void BufferChainInit  ( sout_buffer_chain_t *c )
@@ -273,7 +273,7 @@ static inline void BufferChainInit  ( sout_buffer_chain_t *c )
     c->pp_last = &c->p_first;
 }
 
-static inline void BufferChainAppend( sout_buffer_chain_t *c, block_t *b )
+static inline void BufferChainAppend( sout_buffer_chain_t *c, vlc_frame_t *b )
 {
     *c->pp_last = b;
     c->i_depth++;
@@ -286,9 +286,9 @@ static inline void BufferChainAppend( sout_buffer_chain_t *c, block_t *b )
     c->pp_last = &b->p_next;
 }
 
-static inline block_t *BufferChainGet( sout_buffer_chain_t *c )
+static inline vlc_frame_t *BufferChainGet( sout_buffer_chain_t *c )
 {
-    block_t *b = c->p_first;
+    vlc_frame_t *b = c->p_first;
 
     if( b )
     {
@@ -305,20 +305,20 @@ static inline block_t *BufferChainGet( sout_buffer_chain_t *c )
     return b;
 }
 
-static inline block_t *BufferChainPeek( sout_buffer_chain_t *c )
+static inline vlc_frame_t *BufferChainPeek( sout_buffer_chain_t *c )
 {
-    block_t *b = c->p_first;
+    vlc_frame_t *b = c->p_first;
 
     return b;
 }
 
 static inline void BufferChainClean( sout_buffer_chain_t *c )
 {
-    block_t *b;
+    vlc_frame_t *b;
 
     while( ( b = BufferChainGet( c ) ) )
     {
-        block_Release( b );
+        vlc_frame_Release( b );
     }
     BufferChainInit( c );
 }
@@ -471,8 +471,8 @@ static int AddStream( sout_mux_t *, sout_input_t * );
 static void DelStream( sout_mux_t *, sout_input_t * );
 static int Mux      ( sout_mux_t * );
 
-static block_t *FixPES( sout_mux_t *p_mux, block_fifo_t *p_fifo );
-static block_t *Add_ADTS( block_t *, const es_format_t * );
+static vlc_frame_t *FixPES( sout_mux_t *p_mux, vlc_frame_fifo_t *p_fifo );
+static vlc_frame_t *Add_ADTS( vlc_frame_t *, const es_format_t * );
 static void TSSchedule  ( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
                           vlc_tick_t i_pcr_length, vlc_tick_t i_pcr_dts );
 static void TSDate      ( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
@@ -480,8 +480,8 @@ static void TSDate      ( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
 static void GetPAT( sout_mux_t *p_mux, sout_buffer_chain_t *c );
 static void GetPMT( sout_mux_t *p_mux, sout_buffer_chain_t *c );
 
-static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream, bool b_pcr );
-static void TSSetPCR( block_t *p_ts, vlc_tick_t i_dts );
+static vlc_frame_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream, bool b_pcr );
+static void TSSetPCR( vlc_frame_t *p_ts, vlc_tick_t i_dts );
 
 static csa_t *csaSetup( vlc_object_t *p_this )
 {
@@ -1045,19 +1045,19 @@ static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
 static void SetHeader( sout_buffer_chain_t *c,
                         int depth )
 {
-    block_t *p_ts = BufferChainPeek( c );
+    vlc_frame_t *p_ts = BufferChainPeek( c );
     while( depth > 0 )
     {
         p_ts = p_ts->p_next;
         depth--;
     }
-    p_ts->i_flags |= BLOCK_FLAG_HEADER;
+    p_ts->i_flags |= FRAME_FLAG_HEADER;
 }
 
-static block_t *Pack_Opus(block_t *p_data)
+static vlc_frame_t *Pack_Opus(vlc_frame_t *p_data)
 {
     lldiv_t d = lldiv(p_data->i_buffer, 255);
-    p_data = block_Realloc(p_data, 2 + d.quot + 1, p_data->i_buffer);
+    p_data = vlc_frame_Realloc(p_data, 2 + d.quot + 1, p_data->i_buffer);
     if (p_data) { /* no flags */
         p_data->p_buffer[0] = 0x7f;
         p_data->p_buffer[1] = 0xe0;
@@ -1068,17 +1068,17 @@ static block_t *Pack_Opus(block_t *p_data)
     return p_data;
 }
 
-static void SetBlockDuration( sout_input_t *p_input, block_t *p_data )
+static void SetFrameDuration( sout_input_t *p_input, vlc_frame_t *p_data )
 {
     sout_input_sys_t *p_stream = (sout_input_sys_t*) p_input->p_sys;
 
     if( p_input->p_fmt->i_cat != SPU_ES &&
-        block_FifoCount( p_input->p_fifo ) > 0 )
+        vlc_frame_FifoCount( p_input->p_fifo ) > 0 )
     {
-        block_t *p_next = block_FifoShow( p_input->p_fifo );
+        vlc_frame_t *p_next = vlc_frame_FifoShow( p_input->p_fifo );
         vlc_tick_t i_diff = p_next->i_dts - p_data->i_dts;
         if( i_diff > 0 &&
-                (p_next->i_flags & BLOCK_FLAG_DISCONTINUITY) == 0 )
+                (p_next->i_flags & FRAME_FLAG_DISCONTINUITY) == 0 )
         {
             p_data->i_length = i_diff;
         }
@@ -1118,7 +1118,7 @@ static void SetBlockDuration( sout_input_t *p_input, block_t *p_data )
     }
 }
 
-static block_t *Encap_J2K( block_t *p_data, const es_format_t *p_fmt )
+static vlc_frame_t *Encap_J2K( vlc_frame_t *p_data, const es_format_t *p_fmt )
 {
     size_t i_offset = 0;
     uint32_t i_box = 0;
@@ -1144,16 +1144,16 @@ static block_t *Encap_J2K( block_t *p_data, const es_format_t *p_fmt )
 
     if( i_box != J2K_BOX_JP2C )
     {
-        block_Release( p_data );
+        vlc_frame_Release( p_data );
         return NULL;
     }
 
     if( i_offset < 38 )
     {
-        block_t *p_realloc = block_Realloc( p_data, 38 - i_offset, p_data->i_buffer );
+        vlc_frame_t *p_realloc = vlc_frame_Realloc( p_data, 38 - i_offset, p_data->i_buffer );
         if( unlikely(!p_realloc) )
         {
-            block_Release( p_data );
+            vlc_frame_Release( p_data );
             return NULL;
         }
         p_data = p_realloc;
@@ -1237,7 +1237,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
             continue;
 
         /* Need more data */
-        if( block_FifoCount( p_input->p_fifo ) <= 1 )
+        if( vlc_frame_FifoCount( p_input->p_fifo ) <= 1 )
         {
             if( ( p_input->p_fmt->i_cat == AUDIO_ES ) ||
                 ( p_input->p_fmt->i_cat == VIDEO_ES ) )
@@ -1245,7 +1245,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
                 /* We need more data */
                 return true;
             }
-            else if( block_FifoCount( p_input->p_fifo ) <= 0 )
+            else if( vlc_frame_FifoCount( p_input->p_fifo ) <= 0 )
             {
                 /* spu, only one packet is needed */
                 continue;
@@ -1253,7 +1253,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
             else if( p_input->p_fmt->i_cat == SPU_ES )
             {
                 /* Don't mux the SPU yet if it is too early */
-                block_t *p_spu = block_FifoShow( p_input->p_fifo );
+                vlc_frame_t *p_spu = vlc_frame_FifoShow( p_input->p_fifo );
 
                 int64_t i_spu_delay = p_spu->i_dts - p_pcr_stream->state.i_pes_dts;
                 if( ( i_spu_delay > i_shaping_delay ) &&
@@ -1273,12 +1273,12 @@ static bool MuxStreams(sout_mux_t *p_mux )
         }
         b_ok = false;
 
-        block_t *p_data;
+        vlc_frame_t *p_data;
         if( p_stream == p_pcr_stream || p_sys->b_data_alignment
              || ((p_input->p_fmt->i_codec != VLC_CODEC_MPGA ) &&
                  (p_input->p_fmt->i_codec != VLC_CODEC_MP3) ) )
         {
-            p_data = block_FifoGet( p_input->p_fifo );
+            p_data = vlc_frame_FifoGet( p_input->p_fifo );
             if( p_data->i_dts == VLC_TICK_INVALID )
                 p_data->i_dts = p_data->i_pts;
             else if ( p_data->i_pts == VLC_TICK_INVALID )
@@ -1292,12 +1292,12 @@ static bool MuxStreams(sout_mux_t *p_mux )
         else
             p_data = FixPES( p_mux, p_input->p_fifo );
 
-        SetBlockDuration( p_input, p_data );
+        SetFrameDuration( p_input, p_data );
 
         if( p_data->i_dts == VLC_TICK_INVALID )
         {
             msg_Err( p_mux, "non dated packet dropped" );
-            block_Release( p_data );
+            vlc_frame_Release( p_data );
             continue;
         }
 
@@ -1308,12 +1308,12 @@ static bool MuxStreams(sout_mux_t *p_mux )
             for (int j = 0; j < p_mux->i_nb_inputs; j++ )
             {
                 if( p_mux->pp_inputs[j] != p_input &&
-                    block_FifoCount( p_mux->pp_inputs[j]->p_fifo) > 0 )
+                    vlc_frame_FifoCount( p_mux->pp_inputs[j]->p_fifo) > 0 )
                 {
-                    block_t *p_block = block_FifoShow( p_mux->pp_inputs[j]->p_fifo );
-                    if( p_block->i_dts != VLC_TICK_INVALID &&
-                        p_block->i_dts < p_sys->first_dts )
-                        p_sys->first_dts = p_block->i_dts;
+                    vlc_frame_t *p_frame = vlc_frame_FifoShow( p_mux->pp_inputs[j]->p_fifo );
+                    if( p_frame->i_dts != VLC_TICK_INVALID &&
+                        p_frame->i_dts < p_sys->first_dts )
+                        p_sys->first_dts = p_frame->i_dts;
                 }
             }
         }
@@ -1332,7 +1332,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
                       p_stream->ts.i_pid, (char *) &p_input->fmt.i_codec,
                       p_data->i_dts, p_stream->state.i_pes_dts,
                       p_pcr_stream->state.i_pes_dts );
-            block_Release( p_data );
+            vlc_frame_Release( p_data );
 
             BufferChainClean( &p_stream->state.chain_pes );
             p_stream->state.i_pes_dts = 0;
@@ -1357,7 +1357,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
         {
         case VLC_CODEC_SUBT:
             /* Prepend header */
-            p_data = block_Realloc( p_data, 2, p_data->i_buffer );
+            p_data = vlc_frame_Realloc( p_data, 2, p_data->i_buffer );
             p_data->p_buffer[0] = ( (p_data->i_buffer - 2) >> 8) & 0xff;
             p_data->p_buffer[1] = ( (p_data->i_buffer - 2)     ) & 0xff;
 
@@ -1369,7 +1369,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
             if( p_data->i_length > 0 &&
                 ( p_data->i_buffer != 1 || *p_data->p_buffer != ' ' ) )
             {
-                block_t *p_spu = block_Alloc( 3 );
+                vlc_frame_t *p_spu = vlc_frame_Alloc( 3 );
 
                 p_spu->i_dts = p_data->i_dts + p_data->i_length;
                 p_spu->i_pts = p_spu->i_dts;
@@ -1401,7 +1401,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
         {
             if( p_input->fmt.i_codec == VLC_CODEC_JPEG2000 )
             {
-                if( p_data->i_flags & BLOCK_FLAG_INTERLACED_MASK )
+                if( p_data->i_flags & FRAME_FLAG_INTERLACED_MASK )
                     msg_Warn( p_mux, "Unsupported interlaced J2K content. Expect broken result");
                 p_data = Encap_J2K( p_data, &p_input->fmt );
                 if( !p_data )
@@ -1448,8 +1448,8 @@ static bool MuxStreams(sout_mux_t *p_mux )
         BufferChainAppend( &p_stream->state.chain_pes, p_data );
 
         if( p_sys->b_use_key_frames && p_stream == p_pcr_stream
-            && (p_data->i_flags & BLOCK_FLAG_TYPE_I)
-            && !(p_data->i_flags & BLOCK_FLAG_NO_KEYFRAME)
+            && (p_data->i_flags & FRAME_FLAG_TYPE_I)
+            && !(p_data->i_flags & FRAME_FLAG_NO_KEYFRAME)
             && (p_stream->state.i_pes_length > VLC_TICK_FROM_MS(400)) )
         {
             i_shaping_delay = p_stream->state.i_pes_length;
@@ -1469,7 +1469,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
         sout_input_sys_t *p_stream = (sout_input_sys_t*)p_mux->pp_inputs[i]->p_sys;
 
         /* False for pcr stream but it will be enough to do PCR algo */
-        for (block_t *p_pes = p_stream->state.chain_pes.p_first; p_pes != NULL;
+        for (vlc_frame_t *p_pes = p_stream->state.chain_pes.p_first; p_pes != NULL;
              p_pes = p_pes->p_next )
         {
             int i_size = p_pes->i_buffer;
@@ -1542,12 +1542,12 @@ static bool MuxStreams(sout_mux_t *p_mux )
         }
 
         /* Build the TS packet */
-        block_t *p_ts = TSNew( p_mux, p_stream, b_pcr );
+        vlc_frame_t *p_ts = TSNew( p_mux, p_stream, b_pcr );
         if( p_sys->csa != NULL &&
              (p_input->p_fmt->i_cat != AUDIO_ES || p_sys->b_crypt_audio) &&
              (p_input->p_fmt->i_cat != VIDEO_ES || p_sys->b_crypt_video) )
         {
-            p_ts->i_flags |= BLOCK_FLAG_SCRAMBLED;
+            p_ts->i_flags |= FRAME_FLAG_SCRAMBLED;
         }
         i_packet_pos++;
 
@@ -1556,7 +1556,7 @@ static bool MuxStreams(sout_mux_t *p_mux )
          * and start new one with pat,pmt,keyframe*/
         if( ( p_sys->b_use_key_frames ) &&
             ( p_input->p_fmt->i_cat == VIDEO_ES ) &&
-            ( p_ts->i_flags & BLOCK_FLAG_TYPE_I ) )
+            ( p_ts->i_flags & FRAME_FLAG_TYPE_I ) )
         {
             if( likely( !pat_was_previous ) )
             {
@@ -1593,7 +1593,7 @@ static int Mux( sout_mux_t *p_mux )
     {
         for (int i = 0; i < p_mux->i_nb_inputs; i++ )
         {
-            block_FifoEmpty( p_mux->pp_inputs[i]->p_fifo );
+            vlc_frame_FifoEmpty( p_mux->pp_inputs[i]->p_fifo );
         }
         msg_Dbg( p_mux, "waiting for PCR streams" );
         return VLC_SUCCESS;
@@ -1605,22 +1605,22 @@ static int Mux( sout_mux_t *p_mux )
 }
 
 #define STD_PES_PAYLOAD 170
-static block_t *FixPES( sout_mux_t *p_mux, block_fifo_t *p_fifo )
+static vlc_frame_t *FixPES( sout_mux_t *p_mux, vlc_frame_fifo_t *p_fifo )
 {
     VLC_UNUSED(p_mux);
-    block_t *p_data;
+    vlc_frame_t *p_data;
     size_t i_size;
 
-    p_data = block_FifoShow( p_fifo );
+    p_data = vlc_frame_FifoShow( p_fifo );
     i_size = p_data->i_buffer;
 
     if( i_size == STD_PES_PAYLOAD )
     {
-        return block_FifoGet( p_fifo );
+        return vlc_frame_FifoGet( p_fifo );
     }
     else if( i_size > STD_PES_PAYLOAD )
     {
-        block_t *p_new = block_Alloc( STD_PES_PAYLOAD );
+        vlc_frame_t *p_new = vlc_frame_Alloc( STD_PES_PAYLOAD );
         memcpy( p_new->p_buffer, p_data->p_buffer, STD_PES_PAYLOAD );
         p_new->i_pts = p_data->i_pts;
         p_new->i_dts = p_data->i_dts;
@@ -1631,20 +1631,20 @@ static block_t *FixPES( sout_mux_t *p_mux, block_fifo_t *p_fifo )
         p_data->i_pts += p_new->i_length;
         p_data->i_dts += p_new->i_length;
         p_data->i_length -= p_new->i_length;
-        p_data->i_flags |= BLOCK_FLAG_NO_KEYFRAME;
+        p_data->i_flags |= FRAME_FLAG_NO_KEYFRAME;
         return p_new;
     }
     else
     {
-        block_t *p_next;
+        vlc_frame_t *p_next;
         int i_copy;
 
-        p_data = block_FifoGet( p_fifo );
-        p_data = block_Realloc( p_data, 0, STD_PES_PAYLOAD );
-        p_next = block_FifoShow( p_fifo );
-        if ( p_data->i_flags & BLOCK_FLAG_NO_KEYFRAME )
+        p_data = vlc_frame_FifoGet( p_fifo );
+        p_data = vlc_frame_Realloc( p_data, 0, STD_PES_PAYLOAD );
+        p_next = vlc_frame_FifoShow( p_fifo );
+        if ( p_data->i_flags & FRAME_FLAG_NO_KEYFRAME )
         {
-            p_data->i_flags &= ~BLOCK_FLAG_NO_KEYFRAME;
+            p_data->i_flags &= ~FRAME_FLAG_NO_KEYFRAME;
             p_data->i_pts = p_next->i_pts;
             p_data->i_dts = p_next->i_dts;
         }
@@ -1659,18 +1659,18 @@ static block_t *FixPES( sout_mux_t *p_mux, block_fifo_t *p_fifo )
         p_next->i_length -= offset;
         p_next->i_buffer -= i_copy;
         p_next->p_buffer += i_copy;
-        p_next->i_flags |= BLOCK_FLAG_NO_KEYFRAME;
+        p_next->i_flags |= FRAME_FLAG_NO_KEYFRAME;
 
         if( !p_next->i_buffer )
         {
-            p_next = block_FifoGet( p_fifo );
-            block_Release( p_next );
+            p_next = vlc_frame_FifoGet( p_fifo );
+            vlc_frame_Release( p_next );
         }
         return p_data;
     }
 }
 
-static block_t *Add_ADTS( block_t *p_data, const es_format_t *p_fmt )
+static vlc_frame_t *Add_ADTS( vlc_frame_t *p_data, const es_format_t *p_fmt )
 {
 #define ADTS_HEADER_SIZE 7 /* CRC needs 2 more bytes */
 
@@ -1688,9 +1688,9 @@ static block_t *Add_ADTS( block_t *p_data, const es_format_t *p_fmt )
 
     int i_channels = (p_extra[i_index == 0x0f ? 4 : 1] >> 3) & 0x0f;
 
-    block_t *p_new_block = block_Realloc( p_data, ADTS_HEADER_SIZE,
+    vlc_frame_t *p_new_frame = vlc_frame_Realloc( p_data, ADTS_HEADER_SIZE,
                                             p_data->i_buffer );
-    uint8_t *p_buffer = p_new_block->p_buffer;
+    uint8_t *p_buffer = p_new_frame->p_buffer;
 
     /* fixed header */
     p_buffer[0] = 0xff;
@@ -1708,7 +1708,7 @@ static block_t *Add_ADTS( block_t *p_data, const es_format_t *p_fmt )
     p_buffer[5] = ((frame_length & 0x07) << 5) | ((i_fullness >> 6) & 0x1f);
     p_buffer[6] = ((i_fullness & 0x3f) << 2) /* | 0xfc */;
 
-    return p_new_block;
+    return p_new_frame;
 }
 
 static void TSSchedule( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
@@ -1727,7 +1727,7 @@ static void TSSchedule( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
 
     for (int i = 0; i < i_packet_count; i++ )
     {
-        block_t *p_ts = BufferChainGet( p_chain_ts );
+        vlc_frame_t *p_ts = BufferChainGet( p_chain_ts );
         vlc_tick_t i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count;
 
         BufferChainAppend( &new_chain, p_ts );
@@ -1795,18 +1795,18 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
     /* msg_Dbg( p_mux, "real pck=%d", i_packet_count ); */
     for (int i = 0; i < i_packet_count; i++ )
     {
-        block_t *p_ts = BufferChainGet( p_chain_ts );
+        vlc_frame_t *p_ts = BufferChainGet( p_chain_ts );
         vlc_tick_t i_new_dts = i_pcr_dts + i_pcr_length * i / i_packet_count;
 
         p_ts->i_dts    = i_new_dts;
         p_ts->i_length = i_pcr_length / i_packet_count;
 
-        if( p_ts->i_flags & BLOCK_FLAG_CLOCK )
+        if( p_ts->i_flags & FRAME_FLAG_CLOCK )
         {
             /* msg_Dbg( p_mux, "pcr=%lld ms", p_ts->i_dts / 1000 ); */
             TSSetPCR( p_ts, p_ts->i_dts - p_sys->first_dts );
         }
-        if( p_ts->i_flags & BLOCK_FLAG_SCRAMBLED )
+        if( p_ts->i_flags & FRAME_FLAG_SCRAMBLED )
         {
             vlc_mutex_lock( &p_sys->csa_lock );
             csa_Encrypt( p_sys->csa, p_ts->p_buffer, p_sys->i_csa_pkt_size );
@@ -1820,11 +1820,11 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
     }
 }
 
-static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
+static vlc_frame_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
                        bool b_pcr )
 {
     VLC_UNUSED(p_mux);
-    block_t *p_pes = p_stream->state.chain_pes.p_first;
+    vlc_frame_t *p_pes = p_stream->state.chain_pes.p_first;
 
     bool b_new_pes = false;
     bool b_adaptation_field = false;
@@ -1843,11 +1843,11 @@ static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
         b_adaptation_field = true;
     }
 
-    block_t *p_ts = block_Alloc( 188 );
+    vlc_frame_t *p_ts = vlc_frame_Alloc( 188 );
 
-    if (b_new_pes && !(p_pes->i_flags & BLOCK_FLAG_NO_KEYFRAME) && p_pes->i_flags & BLOCK_FLAG_TYPE_I)
+    if (b_new_pes && !(p_pes->i_flags & FRAME_FLAG_NO_KEYFRAME) && p_pes->i_flags & FRAME_FLAG_TYPE_I)
     {
-        p_ts->i_flags |= BLOCK_FLAG_TYPE_I;
+        p_ts->i_flags |= FRAME_FLAG_TYPE_I;
     }
 
     p_ts->i_dts = p_pes->i_dts;
@@ -1860,14 +1860,14 @@ static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
         p_stream->ts.i_continuity_counter;
 
     p_stream->ts.i_continuity_counter = (p_stream->ts.i_continuity_counter+1)%16;
-    p_stream->ts.b_discontinuity = p_pes->i_flags & BLOCK_FLAG_DISCONTINUITY;
+    p_stream->ts.b_discontinuity = p_pes->i_flags & FRAME_FLAG_DISCONTINUITY;
 
     if( b_adaptation_field )
     {
         int i_stuffing = i_payload_max - i_payload;
         if( b_pcr )
         {
-            p_ts->i_flags |= BLOCK_FLAG_CLOCK;
+            p_ts->i_flags |= FRAME_FLAG_CLOCK;
 
             p_ts->p_buffer[4] = 7 + i_stuffing;
             p_ts->p_buffer[5] = 1 << 4; /* PCR_flag */
@@ -1900,7 +1900,7 @@ static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
 
     if( p_stream->state.i_pes_used >= (int)p_pes->i_buffer )
     {
-        block_Release(BufferChainGet( &p_stream->state.chain_pes ));
+        vlc_frame_Release(BufferChainGet( &p_stream->state.chain_pes ));
 
         p_pes = p_stream->state.chain_pes.p_first;
         p_stream->state.i_pes_length = 0;
@@ -1923,7 +1923,7 @@ static block_t *TSNew( sout_mux_t *p_mux, sout_input_sys_t *p_stream,
     return p_ts;
 }
 
-static void TSSetPCR( block_t *p_ts, vlc_tick_t i_dts )
+static void TSSetPCR( vlc_frame_t *p_ts, vlc_tick_t i_dts )
 {
     int64_t i_pcr = TO_SCALE_NZ(i_dts);
 
diff --git a/modules/mux/mpeg/tsutil.c b/modules/mux/mpeg/tsutil.c
index 21668a0676..9ff8d86a21 100644
--- a/modules/mux/mpeg/tsutil.c
+++ b/modules/mux/mpeg/tsutil.c
@@ -22,11 +22,11 @@
 #endif
 
 #include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 #include "tsutil.h"
 
-void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, block_t *p_pes,
+void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, vlc_frame_t *p_pes,
               uint16_t i_pid, bool *pb_discontinuity, uint8_t *pi_continuity_counter )
 {
     /* get PES total size */
@@ -50,7 +50,7 @@ void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, block_t *p_pes,
 
         int i_copy = __MIN( i_size, 184 );
         bool b_adaptation_field = i_size < 184;
-        block_t *p_ts = block_Alloc( 188 );
+        vlc_frame_t *p_ts = vlc_frame_Alloc( 188 );
 
         p_ts->p_buffer[0] = 0x47;
         p_ts->p_buffer[1] = ( b_new_pes ? 0x40 : 0x00 )|
@@ -90,10 +90,10 @@ void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, block_t *p_pes,
 
         if( i_size <= 0 )
         {
-            block_t *p_next = p_pes->p_next;
+            vlc_frame_t *p_next = p_pes->p_next;
 
             p_pes->p_next = NULL;
-            block_Release( p_pes );
+            vlc_frame_Release( p_pes );
             if( p_next == NULL )
                 return;
 
diff --git a/modules/mux/mpeg/tsutil.h b/modules/mux/mpeg/tsutil.h
index fa8b084231..0ea4350fba 100644
--- a/modules/mux/mpeg/tsutil.h
+++ b/modules/mux/mpeg/tsutil.h
@@ -20,9 +20,9 @@
 #ifndef VLC_MPEG_TSUTIL_H_
 #define VLC_MPEG_TSUTIL_H_
 
-typedef void(*PEStoTSCallback)(void *, block_t *);
+typedef void(*PEStoTSCallback)(void *, vlc_frame_t *);
 
-void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, block_t *p_pes,
+void PEStoTS( void *p_opaque, PEStoTSCallback pf_callback, vlc_frame_t *p_pes,
               uint16_t i_pid, bool *pb_discontinuity, uint8_t *pi_continuity_counter );
 
 #endif
diff --git a/modules/mux/mpjpeg.c b/modules/mux/mpjpeg.c
index bd431cdf8d..ba966ce1c9 100644
--- a/modules/mux/mpjpeg.c
+++ b/modules/mux/mpjpeg.c
@@ -31,7 +31,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -143,32 +143,32 @@ static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
 
 static int Mux( sout_mux_t *p_mux )
 {
-    block_fifo_t *p_fifo;
+    vlc_frame_fifo_t *p_fifo;
 
     if( !p_mux->i_nb_inputs ) return VLC_SUCCESS;
 
     p_fifo = p_mux->pp_inputs[0]->p_fifo;
 
-    while( block_FifoCount( p_fifo ) > 0 )
+    while( vlc_frame_FifoCount( p_fifo ) > 0 )
     {
         static const char psz_hfmt[] = "\r\n"
             "--"BOUNDARY"\r\n"
             "Content-Type: image/jpeg\r\n"
             "Content-Length: %zu\r\n"
             "\r\n";
-        block_t *p_data = block_FifoGet( p_fifo );
-        block_t *p_header = block_Alloc( sizeof( psz_hfmt ) + 20 );
+        vlc_frame_t *p_data = vlc_frame_FifoGet( p_fifo );
+        vlc_frame_t *p_header = vlc_frame_Alloc( sizeof( psz_hfmt ) + 20 );
 
         if( p_header == NULL ) /* uho! */
         {
-            block_Release( p_data );
+            vlc_frame_Release( p_data );
             continue;
         }
 
         p_header->i_buffer =
             snprintf( (char *)p_header->p_buffer, p_header->i_buffer,
                       psz_hfmt, p_data->i_buffer );
-        p_header->i_flags |= BLOCK_FLAG_HEADER;
+        p_header->i_flags |= FRAME_FLAG_HEADER;
         sout_AccessOutWrite( p_mux->p_access, p_header );
         sout_AccessOutWrite( p_mux->p_access, p_data );
     }
diff --git a/modules/mux/ogg.c b/modules/mux/ogg.c
index 3baff56e78..0b98efc58e 100644
--- a/modules/mux/ogg.c
+++ b/modules/mux/ogg.c
@@ -32,7 +32,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_codecs.h>
 #include <limits.h>
 #include <vlc_rand.h>
@@ -76,7 +76,7 @@ static int Control  ( sout_mux_t *, int, va_list );
 static int AddStream( sout_mux_t *, sout_input_t * );
 static void DelStream( sout_mux_t *, sout_input_t * );
 static int Mux      ( sout_mux_t * );
-static int MuxBlock ( sout_mux_t *, sout_input_t * );
+static int MuxFrame ( sout_mux_t *, sout_input_t * );
 
 static bool OggCreateHeaders( sout_mux_t * );
 static void OggFillSkeletonFishead( uint8_t *p_buffer, sout_mux_t *p_mux );
@@ -220,8 +220,8 @@ typedef struct
     ssize_t i_segment_start;
 } sout_mux_sys_t;
 
-static void OggSetDate( block_t *, vlc_tick_t , vlc_tick_t );
-static block_t *OggStreamFlush( sout_mux_t *, ogg_stream_state *, vlc_tick_t );
+static void OggSetDate( vlc_frame_t *, vlc_tick_t , vlc_tick_t );
+static vlc_frame_t *OggStreamFlush( sout_mux_t *, ogg_stream_state *, vlc_tick_t );
 static void OggCreateStreamFooter( sout_mux_t *p_mux, ogg_stream_t *p_stream );
 static void OggRewriteFisheadPage( sout_mux_t *p_mux );
 static bool AllocateIndex( sout_mux_t *p_mux, sout_input_t *p_input );
@@ -557,7 +557,7 @@ static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
 {
     sout_mux_sys_t *p_sys  = p_mux->p_sys;
     ogg_stream_t   *p_stream = (ogg_stream_t*)p_input->p_sys;
-    block_t *p_og;
+    vlc_frame_t *p_og;
 
     msg_Dbg( p_mux, "removing input" );
 
@@ -566,8 +566,8 @@ static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
     {
         if( !p_stream->b_new )
         {
-            while( block_FifoCount( p_input->p_fifo ) )
-                MuxBlock( p_mux, p_input );
+            while( vlc_frame_FifoCount( p_input->p_fifo ) )
+                MuxFrame( p_mux, p_input );
         }
 
         if( !p_stream->b_new &&
@@ -667,19 +667,19 @@ static bool AddIndexEntry( sout_mux_t *p_mux, vlc_tick_t i_time, sout_input_t *p
 /*****************************************************************************
  * Ogg bitstream manipulation routines
  *****************************************************************************/
-static block_t *OggStreamGetPage( sout_mux_t *p_mux,
+static vlc_frame_t *OggStreamGetPage( sout_mux_t *p_mux,
                                   ogg_stream_state *p_os, vlc_tick_t i_pts,
                                   bool flush )
 {
     (void)p_mux;
-    block_t *p_og, *p_og_first = NULL;
+    vlc_frame_t *p_og, *p_og_first = NULL;
     ogg_page og;
     int (*pager)( ogg_stream_state*, ogg_page* ) = flush ? ogg_stream_flush : ogg_stream_pageout;
 
     while( pager( p_os, &og ) )
     {
         /* Flush all data */
-        p_og = block_Alloc( og.header_len + og.body_len );
+        p_og = vlc_frame_Alloc( og.header_len + og.body_len );
 
         memcpy( p_og->p_buffer, og.header, og.header_len );
         memcpy( p_og->p_buffer + og.header_len, og.body, og.body_len );
@@ -689,19 +689,19 @@ static block_t *OggStreamGetPage( sout_mux_t *p_mux,
 
         i_pts = 0; // write it only once
 
-        block_ChainAppend( &p_og_first, p_og );
+        vlc_frame_ChainAppend( &p_og_first, p_og );
     }
 
     return p_og_first;
 }
 
-static block_t *OggStreamFlush( sout_mux_t *p_mux,
+static vlc_frame_t *OggStreamFlush( sout_mux_t *p_mux,
                                 ogg_stream_state *p_os, vlc_tick_t i_pts )
 {
     return OggStreamGetPage( p_mux, p_os, i_pts, true );
 }
 
-static block_t *OggStreamPageOut( sout_mux_t *p_mux,
+static vlc_frame_t *OggStreamPageOut( sout_mux_t *p_mux,
                                   ogg_stream_state *p_os, vlc_tick_t i_pts )
 {
     return OggStreamGetPage( p_mux, p_os, i_pts, false );
@@ -935,8 +935,8 @@ static void OggFillVP8Header( uint8_t *p_buffer, sout_input_t *p_input )
 
 static bool OggCreateHeaders( sout_mux_t *p_mux )
 {
-    block_t *p_hdr = NULL;
-    block_t *p_og = NULL;
+    vlc_frame_t *p_hdr = NULL;
+    vlc_frame_t *p_og = NULL;
     ogg_packet op;
     sout_mux_sys_t *p_sys = p_mux->p_sys;
 
@@ -985,7 +985,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
         ogg_stream_packetin( &p_sys->skeleton.os, &op );
         ogg_packet_clear( &op );
         p_og = OggStreamFlush( p_mux, &p_sys->skeleton.os, 0 );
-        block_ChainAppend( &p_hdr, p_og );
+        vlc_frame_ChainAppend( &p_hdr, p_og );
         p_sys->skeleton.b_head_done = true;
         p_sys->skeleton.i_fishead_offset = p_sys->i_pos;
     }
@@ -1106,7 +1106,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
                 free( op.packet );
             }
 
-            block_ChainAppend( &p_hdr, p_og );
+            vlc_frame_ChainAppend( &p_hdr, p_og );
         }
     }
 
@@ -1127,7 +1127,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
             ogg_stream_packetin( &p_sys->skeleton.os, &op );
             ogg_packet_clear( &op );
             p_og = OggStreamFlush( p_mux, &p_sys->skeleton.os, 0 );
-            block_ChainAppend( &p_hdr, p_og );
+            vlc_frame_ChainAppend( &p_hdr, p_og );
             p_stream->skeleton.b_fisbone_done = true;
         }
     }
@@ -1136,7 +1136,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
     for( p_og = p_hdr; p_og != NULL; p_og = p_og->p_next )
     {
         /* flag headers to be resent for streaming clients */
-        p_og->i_flags |= BLOCK_FLAG_HEADER;
+        p_og->i_flags |= FRAME_FLAG_HEADER;
     }
     p_sys->i_pos += sout_AccessOutWrite( p_mux->p_access, p_hdr );
     p_hdr = NULL;
@@ -1213,7 +1213,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
                 else
                     p_og = OggStreamPageOut( p_mux, &p_stream->os, 0 );
                 if( p_og )
-                    block_ChainAppend( &p_hdr, p_og );
+                    vlc_frame_ChainAppend( &p_hdr, p_og );
             }
         }
         else if( p_stream->fmt.i_codec != VLC_CODEC_FLAC &&
@@ -1235,7 +1235,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
             op.packetno = p_stream->i_packet_no++;
             ogg_stream_packetin( &p_stream->os, &op );
             p_og = OggStreamFlush( p_mux, &p_stream->os, 0 );
-            block_ChainAppend( &p_hdr, p_og );
+            vlc_frame_ChainAppend( &p_hdr, p_og );
         }
 
         /* Special case for mp4v and flac */
@@ -1274,7 +1274,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
             op.packetno = p_stream->i_packet_no++;
             ogg_stream_packetin( &p_stream->os, &op );
             p_og = OggStreamFlush( p_mux, &p_stream->os, 0 );
-            block_ChainAppend( &p_hdr, p_og );
+            vlc_frame_ChainAppend( &p_hdr, p_og );
         }
     }
 
@@ -1289,14 +1289,14 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
         op.packetno = p_sys->skeleton.i_packet_no++;
         ogg_stream_packetin( &p_sys->skeleton.os, &op );
         p_og = OggStreamFlush( p_mux, &p_sys->skeleton.os, 0 );
-        block_ChainAppend( &p_hdr, p_og );
+        vlc_frame_ChainAppend( &p_hdr, p_og );
     }
 
     /* set HEADER flag */
     /* flag headers to be resent for streaming clients */
     for( p_og = p_hdr; p_og != NULL; p_og = p_og->p_next )
     {
-        p_og->i_flags |= BLOCK_FLAG_HEADER;
+        p_og->i_flags |= FRAME_FLAG_HEADER;
     }
 
     /* Write previous headers */
@@ -1307,7 +1307,7 @@ static bool OggCreateHeaders( sout_mux_t *p_mux )
 
 static void OggCreateStreamFooter( sout_mux_t *p_mux, ogg_stream_t *p_stream )
 {
-    block_t *p_og;
+    vlc_frame_t *p_og;
     ogg_packet op;
     sout_mux_sys_t *p_sys = p_mux->p_sys;
 
@@ -1370,10 +1370,10 @@ static void OggCreateStreamFooter( sout_mux_t *p_mux, ogg_stream_t *p_stream )
     ogg_stream_clear( &p_stream->os );
 }
 
-static void OggSetDate( block_t *p_og, vlc_tick_t i_dts, vlc_tick_t i_length )
+static void OggSetDate( vlc_frame_t *p_og, vlc_tick_t i_dts, vlc_tick_t i_length )
 {
     int i_count;
-    block_t *p_tmp;
+    vlc_frame_t *p_tmp;
     vlc_tick_t i_delta;
 
     for( p_tmp = p_og, i_count = 0; p_tmp != NULL; p_tmp = p_tmp->p_next )
@@ -1568,18 +1568,18 @@ static int Mux( sout_mux_t *p_mux )
         int i_stream = sout_MuxGetStream( p_mux, 1, NULL );
         if( i_stream < 0 )
             return VLC_SUCCESS;
-        MuxBlock( p_mux, p_mux->pp_inputs[i_stream] );
+        MuxFrame( p_mux, p_mux->pp_inputs[i_stream] );
     }
 
     return VLC_SUCCESS;
 }
 
-static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
+static int MuxFrame( sout_mux_t *p_mux, sout_input_t *p_input )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
     ogg_stream_t *p_stream = (ogg_stream_t*)p_input->p_sys;
-    block_t *p_data = block_FifoGet( p_input->p_fifo );
-    block_t *p_og = NULL;
+    vlc_frame_t *p_data = vlc_frame_FifoGet( p_input->p_fifo );
+    vlc_frame_t *p_og = NULL;
     ogg_packet op;
     vlc_tick_t i_time;
 
@@ -1592,7 +1592,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
         p_stream->fmt.i_codec != VLC_CODEC_VP8 &&
         p_stream->fmt.i_codec != VLC_CODEC_DIRAC )
     {
-        p_data = block_Realloc( p_data, 1, p_data->i_buffer );
+        p_data = vlc_frame_Realloc( p_data, 1, p_data->i_buffer );
         p_data->p_buffer[0] = PACKET_IS_SYNCPOINT;      // FIXME
     }
 
@@ -1634,7 +1634,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
             p_stream->fmt.i_codec == VLC_CODEC_DAALA )
         {
             p_stream->i_num_frames++;
-            if( p_data->i_flags & BLOCK_FLAG_TYPE_I )
+            if( p_data->i_flags & FRAME_FLAG_TYPE_I )
             {
                 p_stream->i_num_keyframes++;
                 p_stream->i_last_keyframe = p_stream->i_num_frames;
@@ -1677,7 +1677,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
             else
                 p_stream->i_dirac_last_dt = dt;
 
-            if( p_data->i_flags & BLOCK_FLAG_TYPE_I )
+            if( p_data->i_flags & FRAME_FLAG_TYPE_I )
                 p_stream->i_last_keyframe = dt;
             int64_t dist = dt - p_stream->i_last_keyframe;
 
@@ -1704,7 +1704,7 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
         else if( p_stream->fmt.i_codec == VLC_CODEC_VP8 )
         {
             p_stream->i_num_frames++;
-            if( p_data->i_flags & BLOCK_FLAG_TYPE_I )
+            if( p_data->i_flags & FRAME_FLAG_TYPE_I )
             {
                 p_stream->i_num_keyframes++;
                 p_stream->i_last_keyframe = p_stream->i_num_frames;
@@ -1764,6 +1764,6 @@ static int MuxBlock( sout_mux_t *p_mux, sout_input_t *p_input )
         p_stream->i_length += p_data->i_length;
     }
 
-    block_Release( p_data );
+    vlc_frame_Release( p_data );
     return VLC_SUCCESS;
 }
diff --git a/modules/mux/wav.c b/modules/mux/wav.c
index 8bacf9b9f0..4d712e5a6b 100644
--- a/modules/mux/wav.c
+++ b/modules/mux/wav.c
@@ -32,7 +32,7 @@
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_codecs.h>
 
 /*****************************************************************************
@@ -234,24 +234,24 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
     return VLC_SUCCESS;
 }
 
-static block_t *GetHeader( sout_mux_t *p_mux )
+static vlc_frame_t *GetHeader( sout_mux_t *p_mux )
 {
     sout_mux_sys_t *p_sys = p_mux->p_sys;
-    block_t *p_block =
-        block_Alloc( sizeof( WAVEFORMATEXTENSIBLE ) + 7 * 4 );
+    vlc_frame_t *p_frame =
+        vlc_frame_Alloc( sizeof( WAVEFORMATEXTENSIBLE ) + 7 * 4 );
 
     SetDWLE( &p_sys->waveheader[1],
              20 + (p_sys->b_ext ? 40 : 16) + p_sys->i_data ); /* Length */
     SetDWLE( &p_sys->waveheader2[1], p_sys->i_data ); /* DataLength */
 
-    memcpy( p_block->p_buffer, &p_sys->waveheader, 5 * 4 );
-    memcpy( p_block->p_buffer + 5 * 4, &p_sys->waveformat,
+    memcpy( p_frame->p_buffer, &p_sys->waveheader, 5 * 4 );
+    memcpy( p_frame->p_buffer + 5 * 4, &p_sys->waveformat,
             sizeof( WAVEFORMATEXTENSIBLE ) );
-    memcpy( p_block->p_buffer + 5 * 4 +
+    memcpy( p_frame->p_buffer + 5 * 4 +
             (p_sys->b_ext ? sizeof( WAVEFORMATEXTENSIBLE ) : 16),
             &p_sys->waveheader2, 2 * 4 );
-    if( !p_sys->b_ext ) p_block->i_buffer -= 24;
-    return p_block;
+    if( !p_sys->b_ext ) p_frame->i_buffer -= 24;
+    return p_frame;
 }
 
 static void DelStream( sout_mux_t *p_mux, sout_input_t *p_input )
@@ -281,18 +281,18 @@ static int Mux( sout_mux_t *p_mux )
     p_sys->b_header = false;
 
     p_input = p_mux->pp_inputs[0];
-    while( block_FifoCount( p_input->p_fifo ) > 0 )
+    while( vlc_frame_FifoCount( p_input->p_fifo ) > 0 )
     {
-        block_t *p_block = block_FifoGet( p_input->p_fifo );
-        p_sys->i_data += p_block->i_buffer;
+        vlc_frame_t *p_frame = vlc_frame_FifoGet( p_input->p_fifo );
+        p_sys->i_data += p_frame->i_buffer;
 
         /* Do the channel reordering */
         if( p_sys->i_chans_to_reorder )
-            aout_ChannelReorder( p_block->p_buffer, p_block->i_buffer,
+            aout_ChannelReorder( p_frame->p_buffer, p_frame->i_buffer,
                                  p_sys->i_chans_to_reorder,
                                  p_sys->pi_chan_table, p_input->p_fmt->i_codec );
 
-        sout_AccessOutWrite( p_mux->p_access, p_block );
+        sout_AccessOutWrite( p_mux->p_access, p_frame );
     }
 
     return VLC_SUCCESS;
diff --git a/modules/stream_out/autodel.c b/modules/stream_out/autodel.c
index cb3cbccc39..1b1d48c28e 100644
--- a/modules/stream_out/autodel.c
+++ b/modules/stream_out/autodel.c
@@ -31,7 +31,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -55,7 +55,7 @@ vlc_module_end ()
  *****************************************************************************/
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
 struct sout_stream_id_sys_t
@@ -141,7 +141,7 @@ static void Del( sout_stream_t *p_stream, void *_p_es )
     free( p_es );
 }
 
-static int Send( sout_stream_t *p_stream, void *_p_es, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_p_es, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
     sout_stream_id_sys_t *p_es = (sout_stream_id_sys_t *)_p_es;
@@ -163,7 +163,7 @@ static int Send( sout_stream_t *p_stream, void *_p_es, block_t *p_buffer )
     if ( !p_es->b_error )
         sout_StreamIdSend( p_stream->p_next, p_es->id, p_buffer );
     else
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
 
     for ( i = 0; i < p_sys->i_es_num; i++ )
     {
diff --git a/modules/stream_out/bridge.c b/modules/stream_out/bridge.c
index 003c036f5d..4a6ec01cb1 100644
--- a/modules/stream_out/bridge.c
+++ b/modules/stream_out/bridge.c
@@ -32,7 +32,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -141,19 +140,19 @@ static const char *const ppsz_sout_options_in[] = {
 
 static void *AddOut( sout_stream_t *, const es_format_t * );
 static void  DelOut( sout_stream_t *, void * );
-static int   SendOut( sout_stream_t *, void *, block_t * );
+static int   SendOut( sout_stream_t *, void *, vlc_frame_t * );
 
 static void *AddIn( sout_stream_t *, const es_format_t * );
 static void  DelIn( sout_stream_t *, void * );
-static int   SendIn( sout_stream_t *, void *, block_t * );
+static int   SendIn( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
 
 typedef struct bridged_es_t
 {
     es_format_t fmt;
-    block_t *p_block;
-    block_t **pp_last;
+    vlc_frame_t *p_block;
+    vlc_frame_t **pp_last;
     bool b_empty;
 
     /* bridge in part */
@@ -311,7 +310,7 @@ static void DelOut( sout_stream_t *p_stream, void *id )
     p_es = p_sys->p_es;
 
     p_es->b_empty = true;
-    block_ChainRelease( p_es->p_block );
+    vlc_frame_ChainRelease( p_es->p_block );
     p_es->p_block = NULL;
 
     p_es->b_changed = true;
@@ -320,14 +319,14 @@ static void DelOut( sout_stream_t *p_stream, void *id )
     p_sys->b_inited = false;
 }
 
-static int SendOut( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int SendOut( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     out_sout_stream_sys_t *p_sys = (out_sout_stream_sys_t *)p_stream->p_sys;
     bridged_es_t *p_es;
 
     if ( (out_sout_stream_sys_t *)id != p_sys )
     {
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
         return VLC_SUCCESS;
     }
 
@@ -501,7 +500,7 @@ static void DelIn( sout_stream_t *p_stream, void *_id )
     free( id );
 }
 
-static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int SendIn( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     vlc_object_t *vlc = VLC_OBJECT(vlc_object_instance(p_stream));
     in_sout_stream_sys_t *p_sys = (in_sout_stream_sys_t *)p_stream->p_sys;
@@ -533,12 +532,12 @@ static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
                       || p_bridge->pp_es[i]->p_block->i_dts + p_sys->i_delay
                           < p_bridge->pp_es[i]->i_last) )
         {
-            block_t *p_block = p_bridge->pp_es[i]->p_block;
+            vlc_frame_t *p_block = p_bridge->pp_es[i]->p_block;
             msg_Dbg( p_stream, "dropping a packet (%"PRId64 ")",
                      i_date - p_block->i_dts - p_sys->i_delay );
             p_bridge->pp_es[i]->p_block
                 = p_bridge->pp_es[i]->p_block->p_next;
-            block_Release( p_block );
+            vlc_frame_Release( p_block );
         }
 
         if ( p_bridge->pp_es[i]->p_block == NULL )
@@ -598,7 +597,7 @@ static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
 
         if ( p_bridge->pp_es[i]->id != NULL || p_sys->b_placeholder)
         {
-            block_t *p_block = p_bridge->pp_es[i]->p_block;
+            vlc_frame_t *p_block = p_bridge->pp_es[i]->p_block;
             while ( p_block != NULL )
             {
                 p_bridge->pp_es[i]->i_last = p_block->i_dts;
@@ -619,7 +618,7 @@ static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
                         if( !p_sys->b_switch_on_iframe ||
                             p_sys->i_state == placeholder_off ||
                             ( p_bridge->pp_es[i]->fmt.i_cat == VIDEO_ES &&
-                              p_bridge->pp_es[i]->p_block->i_flags & BLOCK_FLAG_TYPE_I ) )
+                              p_bridge->pp_es[i]->p_block->i_flags & FRAME_FLAG_TYPE_I ) )
                         {
                             sout_StreamIdSend( p_stream->p_next,
                                        newid,
@@ -647,7 +646,7 @@ static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
         }
         else
         {
-            block_ChainRelease( p_bridge->pp_es[i]->p_block );
+            vlc_frame_ChainRelease( p_bridge->pp_es[i]->p_block );
         }
 
         p_bridge->pp_es[i]->p_block = NULL;
@@ -671,25 +670,25 @@ static int SendIn( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
             case VIDEO_ES:
                 if( ( p_sys->i_last_video + p_sys->i_placeholder_delay < i_date
                     && (  !p_sys->b_switch_on_iframe
-                       || p_buffer->i_flags & BLOCK_FLAG_TYPE_I ) )
+                       || p_buffer->i_flags & FRAME_FLAG_TYPE_I ) )
                   || p_sys->i_state == placeholder_on )
                 {
                     sout_StreamIdSend( p_stream->p_next, id->id, p_buffer );
                     p_sys->i_state = placeholder_on;
                 }
                 else
-                    block_Release( p_buffer );
+                    vlc_frame_Release( p_buffer );
                 break;
 
             case AUDIO_ES:
                 if( p_sys->i_last_audio + p_sys->i_placeholder_delay < i_date )
                     sout_StreamIdSend( p_stream->p_next, id->id, p_buffer );
                 else
-                    block_Release( p_buffer );
+                    vlc_frame_Release( p_buffer );
                 break;
 
             default:
-                block_Release( p_buffer ); /* FIXME: placeholder subs anyone? */
+                vlc_frame_Release( p_buffer ); /* FIXME: placeholder subs anyone? */
                 break;
         }
     }
diff --git a/modules/stream_out/chromaprint.c b/modules/stream_out/chromaprint.c
index e81b6b12c4..1c5073df5c 100644
--- a/modules/stream_out/chromaprint.c
+++ b/modules/stream_out/chromaprint.c
@@ -29,7 +29,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_input.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_sout.h>
 
 #include <assert.h>
@@ -49,7 +49,7 @@ static void     Close   ( vlc_object_t * );
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 /*****************************************************************************
  * Module descriptor
@@ -210,7 +210,7 @@ static void Del( sout_stream_t *p_stream, void *id )
     free( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buf )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buf )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
@@ -218,13 +218,13 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buf )
     if ( p_sys->id != id )
     {
         /* drop the whole buffer at once */
-        block_ChainRelease( p_buf );
+        vlc_frame_ChainRelease( p_buf );
         return VLC_SUCCESS;
     }
 
     while( p_buf )
     {
-        block_t *p_next;
+        vlc_frame_t *p_next;
         int i_samples = p_buf->i_buffer / (BYTESPERSAMPLE * id->i_channels);
         p_sys->i_total_samples += i_samples;
         if ( !p_sys->b_finished && id->i_samples > 0 && p_buf->i_buffer )
@@ -241,7 +241,7 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buf )
             }
         }
         p_next = p_buf->p_next;
-        block_Release( p_buf );
+        vlc_frame_Release( p_buf );
         p_buf = p_next;
     }
 
diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
index e9bba17f98..7b4d97d48c 100644
--- a/modules/stream_out/chromecast/cast.cpp
+++ b/modules/stream_out/chromecast/cast.cpp
@@ -35,7 +35,7 @@
 #include <vlc_dialog.h>
 
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_modules.h>
 #include <vlc_httpd.h>
 
@@ -61,24 +61,24 @@ struct sout_access_out_sys_t
     void stop();
     void prepare(sout_stream_t *p_stream, const std::string &mime);
     int url_cb(httpd_client_t *cl, httpd_message_t *answer, const httpd_message_t *query);
-    void fifo_put_back(block_t *);
-    ssize_t write(sout_access_out_t *p_access, block_t *p_block);
+    void fifo_put_back(vlc_frame_t *);
+    ssize_t write(sout_access_out_t *p_access, vlc_frame_t *p_frame);
     void close();
 
 
 private:
     void clearUnlocked();
     void initCopy();
-    void putCopy(block_t *p_block);
+    void putCopy(vlc_frame_t *p_frame);
     void restoreCopy();
 
     intf_sys_t * const m_intf;
     httpd_url_t       *m_url;
     httpd_client_t    *m_client;
-    vlc_fifo_t        *m_fifo;
-    block_t           *m_header;
-    block_t           *m_copy_chain;
-    block_t           **m_copy_last;
+    vlc_frame_fifo_t  *m_fifo;
+    vlc_frame_t           *m_header;
+    vlc_frame_t           *m_copy_chain;
+    vlc_frame_t           **m_copy_last;
     size_t             m_copy_size;
     bool               m_eof;
     std::string        m_mime;
@@ -265,7 +265,7 @@ static void ProxyDel(sout_stream_t *p_stream, void *_id)
     return sout_StreamIdDel(p_stream->p_next, id);
 }
 
-static int ProxySend(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
+static int ProxySend(sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer)
 {
     sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
     sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
@@ -274,20 +274,20 @@ static int ProxySend(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
     {
         if (p_sys->has_video)
         {
-            // In case of video, the first block must be a keyframe
+            // In case of video, the first frame must be a keyframe
             if (id == p_sys->video_proxy_id)
             {
                 if (p_sys->first_video_keyframe_pts == -1
-                 && p_buffer->i_flags & BLOCK_FLAG_TYPE_I)
+                 && p_buffer->i_flags & FRAME_FLAG_TYPE_I)
                     p_sys->first_video_keyframe_pts = p_buffer->i_pts;
             }
             else // no keyframe for audio
-                p_buffer->i_flags &= ~BLOCK_FLAG_TYPE_I;
+                p_buffer->i_flags &= ~FRAME_FLAG_TYPE_I;
 
             if (p_buffer->i_pts < p_sys->first_video_keyframe_pts
              || p_sys->first_video_keyframe_pts == -1)
             {
-                block_ChainRelease(p_buffer);
+                vlc_frame_ChainRelease(p_buffer);
                 return VLC_SUCCESS;
             }
         }
@@ -304,7 +304,7 @@ static int ProxySend(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
     }
     else
     {
-        block_ChainRelease(p_buffer);
+        vlc_frame_ChainRelease(p_buffer);
         return VLC_SUCCESS;
     }
 }
@@ -346,13 +346,13 @@ sout_access_out_sys_t::sout_access_out_sys_t(httpd_host_t *httpd_host,
     , m_copy_chain(NULL)
     , m_eof(true)
 {
-    m_fifo = block_FifoNew();
+    m_fifo = vlc_frame_FifoNew();
     if (!m_fifo)
-        throw std::runtime_error( "block_FifoNew failed" );
+        throw std::runtime_error( "vlc_frame_FifoNew failed" );
     m_url = httpd_UrlNew(httpd_host, intf->getHttpStreamPath().c_str(), NULL, NULL);
     if (m_url == NULL)
     {
-        block_FifoRelease(m_fifo);
+        vlc_frame_FifoRelease(m_fifo);
         throw std::runtime_error( "httpd_UrlNew failed" );
     }
     httpd_UrlCatch(m_url, HTTPD_MSG_GET, httpd_url_cb,
@@ -363,15 +363,15 @@ sout_access_out_sys_t::sout_access_out_sys_t(httpd_host_t *httpd_host,
 sout_access_out_sys_t::~sout_access_out_sys_t()
 {
     httpd_UrlDelete(m_url);
-    block_FifoRelease(m_fifo);
+    vlc_frame_FifoRelease(m_fifo);
 }
 
 void sout_access_out_sys_t::clearUnlocked()
 {
-    block_ChainRelease(vlc_fifo_DequeueAllUnlocked(m_fifo));
+    vlc_frame_ChainRelease(vlc_frame_FifoDequeueAllUnlocked(m_fifo));
     if (m_header)
     {
-        block_Release(m_header);
+        vlc_frame_Release(m_header);
         m_header = NULL;
     }
     m_eof = true;
@@ -380,29 +380,29 @@ void sout_access_out_sys_t::clearUnlocked()
 
 void sout_access_out_sys_t::initCopy()
 {
-    block_ChainRelease(m_copy_chain);
+    vlc_frame_ChainRelease(m_copy_chain);
     m_copy_chain = NULL;
     m_copy_last = &m_copy_chain;
     m_copy_size = 0;
 }
 
-void sout_access_out_sys_t::putCopy(block_t *p_block)
+void sout_access_out_sys_t::putCopy(vlc_frame_t *p_frame)
 {
     while (m_copy_size >= HTTPD_BUFFER_COPY_MAX)
     {
         assert(m_copy_chain);
-        block_t *copy = m_copy_chain;
+        vlc_frame_t *copy = m_copy_chain;
         m_copy_chain = copy->p_next;
         m_copy_size -= copy->i_buffer;
-        block_Release(copy);
+        vlc_frame_Release(copy);
     }
     if (!m_copy_chain)
     {
         assert(m_copy_size == 0);
         m_copy_last = &m_copy_chain;
     }
-    block_ChainLastAppend(&m_copy_last, p_block);
-    m_copy_size += p_block->i_buffer;
+    vlc_frame_ChainLastAppend(&m_copy_last, p_frame);
+    m_copy_size += p_frame->i_buffer;
 }
 
 void sout_access_out_sys_t::restoreCopy()
@@ -445,11 +445,11 @@ void sout_access_out_sys_t::prepare(sout_stream_t *p_stream, const std::string &
     vlc_fifo_Unlock(m_fifo);
 }
 
-void sout_access_out_sys_t::fifo_put_back(block_t *p_block)
+void sout_access_out_sys_t::fifo_put_back(vlc_frame_t *p_frame)
 {
-    block_t *p_fifo = vlc_fifo_DequeueAllUnlocked(m_fifo);
-    vlc_fifo_QueueUnlocked(m_fifo, p_block);
-    vlc_fifo_QueueUnlocked(m_fifo, p_fifo);
+    vlc_frame_t *p_fifo = vlc_frame_FifoDequeueAllUnlocked(m_fifo);
+    vlc_frame_FifoQueueUnlocked(m_fifo, p_frame);
+    vlc_frame_FifoQueueUnlocked(m_fifo, p_fifo);
 }
 
 int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
@@ -474,7 +474,7 @@ int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
     while (m_client && vlc_fifo_GetBytes(m_fifo) < i_min_buffer && !m_eof)
         vlc_fifo_Wait(m_fifo);
 
-    block_t *p_block = NULL;
+    vlc_frame_t *p_frame = NULL;
     if (m_client && vlc_fifo_GetBytes(m_fifo) > 0)
     {
         /* if less data is available, then we must be EOF */
@@ -483,15 +483,15 @@ int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
             assert(m_eof);
             i_min_buffer = vlc_fifo_GetBytes(m_fifo);
         }
-        block_t *p_first = vlc_fifo_DequeueUnlocked(m_fifo);
+        vlc_frame_t *p_first = vlc_frame_FifoDequeueUnlocked(m_fifo);
 
         assert(p_first);
         size_t i_total_size = p_first->i_buffer;
-        block_t *p_next = NULL, *p_cur = p_first;
+        vlc_frame_t *p_next = NULL, *p_cur = p_first;
 
         while (i_total_size < i_min_buffer)
         {
-            p_next = vlc_fifo_DequeueUnlocked(m_fifo);
+            p_next = vlc_frame_FifoDequeueUnlocked(m_fifo);
             assert(p_next);
             i_total_size += p_next->i_buffer;
             p_cur->p_next = p_next;
@@ -501,13 +501,13 @@ int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
 
         if (p_next != NULL)
         {
-            p_block = block_Alloc(i_total_size);
-            if (p_block)
-                block_ChainExtract(p_first, p_block->p_buffer, p_block->i_buffer);
-            block_ChainRelease(p_first);
+            p_frame = vlc_frame_Alloc(i_total_size);
+            if (p_frame)
+                vlc_frame_ChainExtract(p_first, p_frame->p_buffer, p_frame->i_buffer);
+            vlc_frame_ChainRelease(p_first);
         }
         else
-            p_block = p_first;
+            p_frame = p_first;
 
         if (vlc_fifo_GetBytes(m_fifo) < HTTPD_BUFFER_PACE)
             m_intf->setPacing(false);
@@ -518,7 +518,7 @@ int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
     answer->i_type   = HTTPD_MSG_ANSWER;
     answer->i_status = 200;
 
-    if (p_block)
+    if (p_frame)
     {
         if (answer->i_body_offset == 0)
         {
@@ -528,7 +528,7 @@ int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
         }
 
         const bool send_header = answer->i_body_offset == 0 && m_header != NULL;
-        size_t i_answer_size = p_block->i_buffer;
+        size_t i_answer_size = p_frame->i_buffer;
         if (send_header)
             i_answer_size += m_header->i_buffer;
 
@@ -543,10 +543,10 @@ int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
                 memcpy(answer->p_body, m_header->p_buffer, m_header->i_buffer);
                 i_block_offset = m_header->i_buffer;
             }
-            memcpy(&answer->p_body[i_block_offset], p_block->p_buffer, p_block->i_buffer);
+            memcpy(&answer->p_body[i_block_offset], p_frame->p_buffer, p_frame->i_buffer);
         }
 
-        putCopy(p_block);
+        putCopy(p_frame);
     }
     if (!answer->i_body)
         httpd_MsgAdd(answer, "Connection", "close");
@@ -555,17 +555,17 @@ int sout_access_out_sys_t::url_cb(httpd_client_t *cl, httpd_message_t *answer,
     return VLC_SUCCESS;
 }
 
-ssize_t sout_access_out_sys_t::write(sout_access_out_t *p_access, block_t *p_block)
+ssize_t sout_access_out_sys_t::write(sout_access_out_t *p_access, vlc_frame_t *p_frame)
 {
-    size_t i_len = p_block->i_buffer;
+    size_t i_len = p_frame->i_buffer;
 
     vlc_fifo_Lock(m_fifo);
 
-    if (p_block->i_flags & BLOCK_FLAG_HEADER)
+    if (p_frame->i_flags & FRAME_FLAG_HEADER)
     {
         if (m_header)
-            block_Release(m_header);
-        m_header = p_block;
+            vlc_frame_Release(m_header);
+        m_header = p_frame;
     }
     else
     {
@@ -576,21 +576,21 @@ ssize_t sout_access_out_sys_t::write(sout_access_out_t *p_access, block_t *p_blo
              * decoder thread) and the demux filter (controlled by the input
              * thread). When the httpd FIFO reaches a specific size, we tell
              * the demux filter to pace and wait a little before queing this
-             * block, but not too long since we don't want to block decoder
+             * frame, but not too long since we don't want to block decoder
              * thread controls. If the pacing fails (should not happen), we
-             * drop the first block in order to make room. The demux filter
+             * drop the first frame in order to make room. The demux filter
              * will be unpaced when the data is read from the httpd thread. */
 
             m_intf->setPacing(true);
 
             while (vlc_fifo_GetBytes(m_fifo) >= HTTPD_BUFFER_MAX)
             {
-                block_t *p_drop = vlc_fifo_DequeueUnlocked(m_fifo);
+                vlc_frame_t *p_drop = vlc_frame_FifoDequeueUnlocked(m_fifo);
                 msg_Warn(p_access, "httpd buffer full: dropping %zuB", p_drop->i_buffer);
-                block_Release(p_drop);
+                vlc_frame_Release(p_drop);
             }
         }
-        vlc_fifo_QueueUnlocked(m_fifo, p_block);
+        vlc_frame_FifoQueueUnlocked(m_fifo, p_frame);
     }
 
     m_eof = false;
@@ -610,10 +610,10 @@ void sout_access_out_sys_t::close()
     vlc_fifo_Signal(m_fifo);
 }
 
-ssize_t AccessWrite(sout_access_out_t *p_access, block_t *p_block)
+ssize_t AccessWrite(sout_access_out_t *p_access, vlc_frame_t *p_frame)
 {
     sout_access_out_sys_t *p_sys = reinterpret_cast<sout_access_out_sys_t *>( p_access->p_sys );
-    return p_sys->write(p_access, p_block);
+    return p_sys->write(p_access, p_frame);
 }
 
 static int AccessControl(sout_access_out_t *p_access, int i_query, va_list args)
@@ -1136,7 +1136,7 @@ bool sout_stream_sys_t::isFlushing( sout_stream_t *p_stream )
     return false;
 }
 
-static int Send(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
+static int Send(sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer)
 {
     sout_stream_sys_t *p_sys = reinterpret_cast<sout_stream_sys_t *>( p_stream->p_sys );
     sout_stream_id_sys_t *id = reinterpret_cast<sout_stream_id_sys_t *>( _id );
@@ -1144,14 +1144,14 @@ static int Send(sout_stream_t *p_stream, void *_id, block_t *p_buffer)
 
     if( p_sys->isFlushing( p_stream ) || p_sys->cc_eof )
     {
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
         return VLC_SUCCESS;
     }
 
     sout_stream_id_sys_t *next_id = p_sys->GetSubId( p_stream, id );
     if ( next_id == NULL )
     {
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
         return VLC_EGENERIC;
     }
 
diff --git a/modules/stream_out/cycle.c b/modules/stream_out/cycle.c
index 0c7481339e..c49fa7b45d 100644
--- a/modules/stream_out/cycle.c
+++ b/modules/stream_out/cycle.c
@@ -33,7 +33,7 @@
 #define VLC_MODULE_LICENSE VLC_LICENSE_GPL_2_PLUS
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_sout.h>
 
 typedef struct sout_cycle sout_cycle_t;
@@ -62,13 +62,13 @@ typedef struct
 
     sout_cycle_t *start;
     sout_cycle_t *next;
-    vlc_tick_t (*clock)(const block_t *);
+    vlc_tick_t (*clock)(const vlc_frame_t *);
     vlc_tick_t period; /*< Total cycle duration */
 } sout_stream_sys_t;
 
-static vlc_tick_t get_dts(const block_t *block)
+static vlc_tick_t get_dts(const vlc_frame_t *frame)
 {
-    return block->i_dts;
+    return frame->i_dts;
 }
 
 static void *Add(sout_stream_t *stream, const es_format_t *fmt)
@@ -153,17 +153,17 @@ static void DelStream(sout_stream_t *stream)
     sys->stream = NULL;
 }
 
-static int Send(sout_stream_t *stream, void *_id, block_t *block)
+static int Send(sout_stream_t *stream, void *_id, vlc_frame_t *frame)
 {
     sout_stream_sys_t *sys = stream->p_sys;
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
 
-    for (block_t *next = block->p_next; block != NULL; block = next)
+    for (vlc_frame_t *next = frame->p_next; frame != NULL; frame = next)
     {
-        block->p_next = NULL;
+        frame->p_next = NULL;
 
         /* FIXME: deal with key frames properly */
-        while (sys->clock(block) >= sys->next->offset)
+        while (sys->clock(frame) >= sys->next->offset)
         {
             DelStream(stream);
             AddStream(stream, sys->next->chain);
@@ -175,9 +175,9 @@ static int Send(sout_stream_t *stream, void *_id, block_t *block)
         }
 
         if (sys->stream != NULL)
-            sout_StreamIdSend(sys->stream, id->id, block);
+            sout_StreamIdSend(sys->stream, id->id, frame);
         else
-            block_Release(block);
+            vlc_frame_Release(frame);
     }
     return VLC_SUCCESS;
 }
diff --git a/modules/stream_out/delay.c b/modules/stream_out/delay.c
index ff04a2ed73..32f08cc104 100644
--- a/modules/stream_out/delay.c
+++ b/modules/stream_out/delay.c
@@ -30,7 +30,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -73,7 +73,7 @@ static const char *ppsz_sout_options[] = {
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct
 {
@@ -152,20 +152,20 @@ static void Del( sout_stream_t *p_stream, void *id )
     sout_StreamIdDel( p_stream->p_next, id );
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
 
     if ( id == p_sys->id )
     {
-        block_t *p_block = p_buffer;
-        while ( p_block != NULL )
+        vlc_frame_t *p_frame = p_buffer;
+        while ( p_frame != NULL )
         {
-            if ( p_block->i_pts != VLC_TICK_INVALID )
-                p_block->i_pts += p_sys->i_delay;
-            if ( p_block->i_dts != VLC_TICK_INVALID )
-                p_block->i_dts += p_sys->i_delay;
-            p_block = p_block->p_next;
+            if ( p_frame->i_pts != VLC_TICK_INVALID )
+                p_frame->i_pts += p_sys->i_delay;
+            if ( p_frame->i_dts != VLC_TICK_INVALID )
+                p_frame->i_dts += p_sys->i_delay;
+            p_frame = p_frame->p_next;
         }
     }
 
diff --git a/modules/stream_out/description.c b/modules/stream_out/description.c
index a6c56a4d8b..f3ec2f01df 100644
--- a/modules/stream_out/description.c
+++ b/modules/stream_out/description.c
@@ -31,7 +31,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_input.h>
-#include <vlc_block.h>
 #include <vlc_sout.h>
 
 #include <assert.h>
@@ -44,7 +43,7 @@ static void     Close   ( vlc_object_t * );
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 /*****************************************************************************
  * Module descriptor
@@ -129,12 +128,12 @@ static void Del( sout_stream_t *p_stream, void *id )
     (void) id;
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     VLC_UNUSED(id);
     sout_stream_sys_t *p_sys = p_stream->p_sys;
 
-    block_ChainRelease( p_buffer );
+    vlc_frame_ChainRelease( p_buffer );
 
     if( p_sys->i_stream_start + VLC_TICK_FROM_MS(1500) < vlc_tick_now() )
         vlc_sem_post(p_sys->data->sem);
diff --git a/modules/stream_out/display.c b/modules/stream_out/display.c
index 2d46cfb601..14ba361d22 100644
--- a/modules/stream_out/display.c
+++ b/modules/stream_out/display.c
@@ -32,7 +32,7 @@
 #include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -76,7 +76,7 @@ static const char *const ppsz_sout_options[] = {
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 static int   Control( sout_stream_t *, int, va_list );
 
 typedef struct
@@ -164,13 +164,13 @@ static void Del( sout_stream_t *p_stream, void *id )
     input_DecoderDelete( (decoder_t *)id );
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
 
     while( p_buffer )
     {
-        block_t *p_next = p_buffer->p_next;
+        vlc_frame_t *p_next = p_buffer->p_next;
 
         p_buffer->p_next = NULL;
 
diff --git a/modules/stream_out/dlna/dlna.cpp b/modules/stream_out/dlna/dlna.cpp
index da966442f5..50115e0a7e 100644
--- a/modules/stream_out/dlna/dlna.cpp
+++ b/modules/stream_out/dlna/dlna.cpp
@@ -35,7 +35,6 @@
 #include <vlc_dialog.h>
 #include <vlc_rand.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 
 static const char* AV_TRANSPORT_SERVICE_TYPE = "urn:schemas-upnp-org:service:AVTransport:1";
 static const char* CONNECTION_MANAGER_SERVICE_TYPE = "urn:schemas-upnp-org:service:ConnectionManager:1";
@@ -833,7 +832,7 @@ static void *Add(sout_stream_t *p_stream, const es_format_t *p_fmt)
 }
 
 static int Send(sout_stream_t *p_stream, void *id,
-                block_t *p_buffer)
+                vlc_frame_t *p_buffer)
 {
     sout_stream_sys_t *p_sys = static_cast<sout_stream_sys_t *>( p_stream->p_sys );
     sout_stream_id_sys_t *id_sys = static_cast<sout_stream_id_sys_t*>( id );
@@ -841,7 +840,7 @@ static int Send(sout_stream_t *p_stream, void *id,
     id_sys = p_sys->GetSubId( p_stream, id_sys );
     if ( id_sys == nullptr )
     {
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
         return VLC_EGENERIC;
     }
 
diff --git a/modules/stream_out/dummy.c b/modules/stream_out/dummy.c
index 6b8b33a214..e41182ac71 100644
--- a/modules/stream_out/dummy.c
+++ b/modules/stream_out/dummy.c
@@ -30,7 +30,7 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_sout.h>
 
 /*****************************************************************************
@@ -40,7 +40,7 @@ static int      Open    ( vlc_object_t * );
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del ( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t* );
+static int   Send( sout_stream_t *, void *, vlc_frame_t* );
 
 /*****************************************************************************
  * Module descriptor
@@ -80,10 +80,10 @@ static void Del( sout_stream_t *p_stream, void *id )
     free( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     (void)p_stream; (void)id;
-    block_ChainRelease( p_buffer );
+    vlc_frame_ChainRelease( p_buffer );
     return VLC_SUCCESS;
 }
 
diff --git a/modules/stream_out/duplicate.c b/modules/stream_out/duplicate.c
index 916b264b92..b60df86104 100644
--- a/modules/stream_out/duplicate.c
+++ b/modules/stream_out/duplicate.c
@@ -31,7 +31,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -54,7 +54,7 @@ vlc_module_end ()
  *****************************************************************************/
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct
 {
@@ -285,7 +285,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
 /*****************************************************************************
  * Send:
  *****************************************************************************/
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
@@ -295,7 +295,7 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     /* Loop through the linked list of buffers */
     while( p_buffer )
     {
-        block_t *p_next = p_buffer->p_next;
+        vlc_frame_t *p_next = p_buffer->p_next;
 
         p_buffer->p_next = NULL;
 
@@ -305,7 +305,7 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
 
             if( id->pp_ids[i_stream] )
             {
-                block_t *p_dup = block_Duplicate( p_buffer );
+                vlc_frame_t *p_dup = vlc_frame_Duplicate( p_buffer );
 
                 if( p_dup )
                     sout_StreamIdSend( p_dup_stream, id->pp_ids[i_stream], p_dup );
@@ -319,7 +319,7 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
         }
         else
         {
-            block_Release( p_buffer );
+            vlc_frame_Release( p_buffer );
         }
 
         p_buffer = p_next;
diff --git a/modules/stream_out/es.c b/modules/stream_out/es.c
index f3e06aec40..c699c4d03b 100644
--- a/modules/stream_out/es.c
+++ b/modules/stream_out/es.c
@@ -121,7 +121,7 @@ static const char *const ppsz_sout_options[] = {
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct
 {
@@ -406,7 +406,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
     free( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     VLC_UNUSED(p_stream);
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
diff --git a/modules/stream_out/gather.c b/modules/stream_out/gather.c
index 9f02d43368..658801a1e9 100644
--- a/modules/stream_out/gather.c
+++ b/modules/stream_out/gather.c
@@ -32,7 +32,7 @@
 #include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -52,7 +52,7 @@ vlc_module_end ()
  *****************************************************************************/
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct
 {
@@ -206,13 +206,13 @@ static void Del( sout_stream_t *p_stream, void *_id )
 /*****************************************************************************
  * Send:
  *****************************************************************************/
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
     if ( id->b_streamswap )
     {
         id->b_streamswap = false;
-        p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+        p_buffer->i_flags |= FRAME_FLAG_DISCONTINUITY;
     }
     return sout_StreamIdSend( p_stream->p_next, id->id, p_buffer );
 }
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 12b5d8d41d..bc831f684f 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -32,7 +32,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_codec.h>
 #include <vlc_meta.h>
 
@@ -81,7 +81,7 @@ static int  Open    ( vlc_object_t * );
 static void Close   ( vlc_object_t * );
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 static void decoder_queue_video( decoder_t *p_dec, picture_t *p_pic );
 inline static int video_update_format_decoder( decoder_t *p_dec );
@@ -558,13 +558,13 @@ static void decoder_queue_video( decoder_t *p_dec, picture_t *p_pic )
     vlc_global_unlock( VLC_MOSAIC_MUTEX );
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
 
     if ( (sout_stream_sys_t *)id != p_sys )
     {
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
         return VLC_SUCCESS;
     }
 
diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index 219775ade3..20901f3400 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -32,7 +32,7 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_sout.h>
 #include <vlc_fs.h>
 #include <assert.h>
@@ -76,15 +76,15 @@ static const char *const ppsz_sout_options[] = {
 /* */
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct sout_stream_id_sys_t sout_stream_id_sys_t;
 struct sout_stream_id_sys_t
 {
     es_format_t fmt;
 
-    block_t *p_first;
-    block_t **pp_last;
+    vlc_frame_t *p_first;
+    vlc_frame_t **pp_last;
 
     sout_stream_id_sys_t *id;
 
@@ -112,7 +112,7 @@ typedef struct
 } sout_stream_sys_t;
 
 static void OutputStart( sout_stream_t *p_stream );
-static void OutputSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t * );
+static void OutputSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id, vlc_frame_t * );
 
 /*****************************************************************************
  * Open:
@@ -209,7 +209,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
         OutputStart( p_stream );
 
     if( id->p_first )
-        block_ChainRelease( id->p_first );
+        vlc_frame_ChainRelease( id->p_first );
 
     assert( !id->id || p_sys->p_out );
     if( id->id )
@@ -228,7 +228,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
     free( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
 
@@ -371,14 +371,14 @@ error:
 
 }
 
-static vlc_tick_t BlockTick( const block_t *p_block )
+static vlc_tick_t FrameTick( const vlc_frame_t *p_frame )
 {
-    if( unlikely(!p_block) )
+    if( unlikely(!p_frame) )
         return VLC_TICK_INVALID;
-    else if( likely(p_block->i_dts != VLC_TICK_INVALID) )
-        return p_block->i_dts;
+    else if( likely(p_frame->i_dts != VLC_TICK_INVALID) )
+        return p_frame->i_dts;
     else
-        return p_block->i_pts;
+        return p_frame->i_pts;
 }
 
 static void OutputStart( sout_stream_t *p_stream )
@@ -521,8 +521,8 @@ static void OutputStart( sout_stream_t *p_stream )
         if( !id->id || !id->p_first )
             continue;
 
-        const block_t *p_block = id->p_first;
-        vlc_tick_t i_dts = BlockTick( p_block );
+        const vlc_frame_t *p_frame = id->p_first;
+        vlc_tick_t i_dts = FrameTick( p_frame );
 
         if( i_dts > i_highest_head_dts &&
            ( id->fmt.i_cat == AUDIO_ES || id->fmt.i_cat == VIDEO_ES ) )
@@ -530,11 +530,11 @@ static void OutputStart( sout_stream_t *p_stream )
             i_highest_head_dts = i_dts;
         }
 
-        for( ; p_block != NULL; p_block = p_block->p_next )
+        for( ; p_frame != NULL; p_frame = p_frame->p_next )
         {
-            if( p_block->i_flags & BLOCK_FLAG_TYPE_I )
+            if( p_frame->i_flags & FRAME_FLAG_TYPE_I )
             {
-                i_dts = BlockTick( p_block );
+                i_dts = FrameTick( p_frame );
                 break;
             }
         }
@@ -562,11 +562,11 @@ static void OutputStart( sout_stream_t *p_stream )
             if( !id->id || id->p_first == NULL )
                 continue;
 
-            block_t *p_id_block;
+            vlc_frame_t *p_id_frame;
             vlc_tick_t id_dts = VLC_TICK_INVALID;
-            for( p_id_block = id->p_first; p_id_block; p_id_block = p_id_block->p_next )
+            for( p_id_frame = id->p_first; p_id_frame; p_id_frame = p_id_frame->p_next )
             {
-                id_dts = BlockTick( p_id_block );
+                id_dts = FrameTick( p_id_frame );
                 if( id_dts != VLC_TICK_INVALID )
                     break;
             }
@@ -587,22 +587,22 @@ static void OutputStart( sout_stream_t *p_stream )
 
         if( p_cand != NULL )
         {
-            block_t *p_block = p_cand->p_first;
-            p_cand->p_first = p_block->p_next;
+            vlc_frame_t *p_frame = p_cand->p_first;
+            p_cand->p_first = p_frame->p_next;
             if( p_cand->p_first == NULL )
                 p_cand->pp_last = &p_cand->p_first;
-            p_block->p_next = NULL;
+            p_frame->p_next = NULL;
 
-            if( BlockTick( p_block ) >= p_sys->i_dts_start )
-                OutputSend( p_stream, p_cand, p_block );
+            if( FrameTick( p_frame ) >= p_sys->i_dts_start )
+                OutputSend( p_stream, p_cand, p_frame );
             else
-                block_Release( p_block );
+                vlc_frame_Release( p_frame );
         }
 
     } while( p_cand != NULL );
 }
 
-static void OutputSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id, block_t *p_block )
+static void OutputSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id, vlc_frame_t *p_frame )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
 
@@ -612,36 +612,36 @@ static void OutputSend( sout_stream_t *p_stream, sout_stream_id_sys_t *id, block
          * to be beyong i_dts_start (for stream without key frame) */
         if( unlikely( id->b_wait_key ) )
         {
-            if( p_block->i_flags & BLOCK_FLAG_TYPE_I )
+            if( p_frame->i_flags & FRAME_FLAG_TYPE_I )
             {
                 id->b_wait_key = false;
                 id->b_wait_start = false;
             }
 
-            if( ( p_block->i_flags & BLOCK_FLAG_TYPE_MASK ) == 0 )
+            if( ( p_frame->i_flags & FRAME_FLAG_TYPE_MASK ) == 0 )
                 id->b_wait_key = false;
         }
         if( unlikely( id->b_wait_start ) )
         {
-            if( p_block->i_dts >=p_sys->i_dts_start )
+            if( p_frame->i_dts >=p_sys->i_dts_start )
                 id->b_wait_start = false;
         }
         if( unlikely( id->b_wait_key || id->b_wait_start ) )
-            block_ChainRelease( p_block );
+            vlc_frame_ChainRelease( p_frame );
         else
-            sout_StreamIdSend( p_sys->p_out, id->id, p_block );
+            sout_StreamIdSend( p_sys->p_out, id->id, p_frame );
     }
     else if( p_sys->b_drop )
     {
-        block_ChainRelease( p_block );
+        vlc_frame_ChainRelease( p_frame );
     }
     else
     {
         size_t i_size;
 
-        block_ChainProperties( p_block, NULL, &i_size, NULL );
+        vlc_frame_ChainProperties( p_frame, NULL, &i_size, NULL );
         p_sys->i_size += i_size;
-        block_ChainLastAppend( &id->pp_last, p_block );
+        vlc_frame_ChainLastAppend( &id->pp_last, p_frame );
     }
 }
 
diff --git a/modules/stream_out/rtcp.c b/modules/stream_out/rtcp.c
index d989efac44..1c200b6087 100644
--- a/modules/stream_out/rtcp.c
+++ b/modules/stream_out/rtcp.c
@@ -27,7 +27,7 @@
 #endif
 
 #include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 #include <vlc_network.h>
 #include <vlc_sout.h>
@@ -199,7 +199,7 @@ void CloseRTCP (rtcp_sender_t *rtcp)
 }
 
 
-void SendRTCP (rtcp_sender_t *restrict rtcp, const block_t *rtp)
+void SendRTCP (rtcp_sender_t *restrict rtcp, const vlc_frame_t *rtp)
 {
     if ((rtcp == NULL) /* RTCP sender off */
      || (rtp->i_buffer < 12)) /* too short RTP packet */
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index 3341bde9c5..bc61676292 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -34,7 +34,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 
 #include <vlc_httpd.h>
 #include <vlc_url.h>
@@ -271,11 +271,11 @@ static const char *const ppsz_sout_options[] = {
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 static void *MuxAdd( sout_stream_t *, const es_format_t * );
 static void  MuxDel( sout_stream_t *, void * );
-static int   MuxSend( sout_stream_t *, void *, block_t * );
+static int   MuxSend( sout_stream_t *, void *, vlc_frame_t * );
 
 static sout_access_out_t *GrabberCreate( sout_stream_t *p_sout );
 static void* ThreadSend( void * );
@@ -332,7 +332,7 @@ typedef struct
     /* in case we do TS/PS over rtp */
     sout_mux_t        *p_mux;
     sout_access_out_t *p_grab;
-    block_t           *packet;
+    vlc_frame_t           *packet;
 
     /* */
     vlc_mutex_t      lock_es;
@@ -381,7 +381,7 @@ struct sout_stream_id_sys_t
         vlc_thread_t  thread;
     } listen;
 
-    block_fifo_t     *p_fifo;
+    vlc_frame_fifo_t     *p_fifo;
     vlc_tick_t        i_caching;
 };
 
@@ -655,7 +655,7 @@ static void Close( vlc_object_t * p_this )
 
         if( p_sys->packet )
         {
-            block_Release( p_sys->packet );
+            vlc_frame_Release( p_sys->packet );
         }
     }
 
@@ -1179,12 +1179,12 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
         id->rtsp_id = RtspAddId( p_sys->rtsp, id, GetDWBE( id->ssrc ),
                                  id->rtp_fmt.clock_rate, mcast_fd );
 
-    id->p_fifo = block_FifoNew();
+    id->p_fifo = vlc_frame_FifoNew();
     if( unlikely(id->p_fifo == NULL) )
         goto error;
     if( vlc_clone( &id->thread, ThreadSend, id, VLC_THREAD_PRIORITY_HIGHEST ) )
     {
-        block_FifoRelease( id->p_fifo );
+        vlc_frame_FifoRelease( id->p_fifo );
         id->p_fifo = NULL;
         goto error;
     }
@@ -1227,7 +1227,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
     {
         vlc_cancel( id->thread );
         vlc_join( id->thread, NULL );
-        block_FifoRelease( id->p_fifo );
+        vlc_frame_FifoRelease( id->p_fifo );
     }
 
     free( id->rtp_fmt.fmtp );
@@ -1260,14 +1260,14 @@ static void Del( sout_stream_t *p_stream, void *_id )
     free( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
     assert( ((sout_stream_sys_t *)p_stream->p_sys)->p_mux == NULL );
 
     while( p_buffer != NULL )
     {
-        block_t *p_next = p_buffer->p_next;
+        vlc_frame_t *p_next = p_buffer->p_next;
         p_buffer->p_next = NULL;
 
         /* Send a Vorbis/Theora Packed Configuration packet (RFC 5215 ยง3.1)
@@ -1401,14 +1401,14 @@ static void* ThreadSend( void *data )
 
     for (;;)
     {
-        block_t *out = block_FifoGet( id->p_fifo );
-        block_cleanup_push (out);
+        vlc_frame_t *out = vlc_frame_FifoGet( id->p_fifo );
+        vlc_frame_cleanup_push (out);
 
 #ifdef HAVE_SRTP
         if( id->srtp )
         {   /* FIXME: this is awfully inefficient */
             size_t len = out->i_buffer;
-            out = block_Realloc( out, 0, len + 10 );
+            out = vlc_frame_Realloc( out, 0, len + 10 );
             out->i_buffer = len;
 
             int canc = vlc_savecancel ();
@@ -1418,7 +1418,7 @@ static void* ThreadSend( void *data )
             {
                 msg_Dbg( id->p_stream, "SRTP sending error: %s",
                          vlc_strerror_c(val) );
-                block_Release( out );
+                vlc_frame_Release( out );
                 out = NULL;
             }
             else
@@ -1465,7 +1465,7 @@ static void* ThreadSend( void *data )
         }
         id->i_seq_sent_next = ntohs(((uint16_t *) out->p_buffer)[1]) + 1;
         vlc_mutex_unlock( &id->lock_sink );
-        block_Release( out );
+        vlc_frame_Release( out );
 
         for( unsigned i = 0; i < deadc; i++ )
         {
@@ -1608,7 +1608,7 @@ vlc_tick_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t
     return p_sys->i_pts_zero + npt;
 }
 
-void rtp_packetize_common( sout_stream_id_sys_t *id, block_t *out,
+void rtp_packetize_common( sout_stream_id_sys_t *id, vlc_frame_t *out,
                            bool b_m_bit, vlc_tick_t i_pts )
 {
     if( !id->b_ts_init )
@@ -1654,9 +1654,9 @@ uint16_t rtp_get_extended_sequence( sout_stream_id_sys_t *id )
     return id->i_sequence >> 16;
 }
 
-void rtp_packetize_send( sout_stream_id_sys_t *id, block_t *out )
+void rtp_packetize_send( sout_stream_id_sys_t *id, vlc_frame_t *out )
 {
-    block_FifoPut( id->p_fifo, out );
+    vlc_frame_FifoPut( id->p_fifo, out );
 }
 
 /**
@@ -1691,7 +1691,7 @@ static void *MuxAdd( sout_stream_t *p_stream, const es_format_t *p_fmt )
 }
 
 
-static int MuxSend( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int MuxSend( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     sout_mux_t *p_mux = p_sys->p_mux;
@@ -1713,7 +1713,7 @@ static void MuxDel( sout_stream_t *p_stream, void *id )
 
 
 static ssize_t AccessOutGrabberWriteBuffer( sout_stream_t *p_stream,
-                                            const block_t *p_buffer )
+                                            const vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     sout_stream_id_sys_t *id = p_sys->es[0];
@@ -1723,7 +1723,7 @@ static ssize_t AccessOutGrabberWriteBuffer( sout_stream_t *p_stream,
     uint8_t         *p_data = p_buffer->p_buffer;
     size_t          i_data  = p_buffer->i_buffer;
     size_t          i_max   = id->i_mtu - 12;
-    bool            b_dis   = (p_buffer->i_flags & BLOCK_FLAG_DISCONTINUITY);
+    bool            b_dis   = (p_buffer->i_flags & FRAME_FLAG_DISCONTINUITY);
 
     size_t i_packet = ( p_buffer->i_buffer + i_max - 1 ) / i_max;
 
@@ -1742,7 +1742,7 @@ static ssize_t AccessOutGrabberWriteBuffer( sout_stream_t *p_stream,
         if( p_sys->packet == NULL )
         {
             /* allocate a new packet */
-            p_sys->packet = block_Alloc( id->i_mtu );
+            p_sys->packet = vlc_frame_Alloc( id->i_mtu );
             /* m-bit is discontinuity for MPEG1/2 PS and TS, RFC2250 2.1 */
             rtp_packetize_common( id, p_sys->packet, b_dis, i_dts );
             p_sys->packet->i_buffer = 12;
@@ -1768,18 +1768,18 @@ static ssize_t AccessOutGrabberWriteBuffer( sout_stream_t *p_stream,
 
 
 static ssize_t AccessOutGrabberWrite( sout_access_out_t *p_access,
-                                      block_t *p_buffer )
+                                      vlc_frame_t *p_buffer )
 {
     sout_stream_t *p_stream = (sout_stream_t*)p_access->p_sys;
 
     while( p_buffer )
     {
-        block_t *p_next;
+        vlc_frame_t *p_next;
 
         AccessOutGrabberWriteBuffer( p_stream, p_buffer );
 
         p_next = p_buffer->p_next;
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
         p_buffer = p_next;
     }
 
diff --git a/modules/stream_out/rtp.h b/modules/stream_out/rtp.h
index 2b1838f679..971bde2f1e 100644
--- a/modules/stream_out/rtp.h
+++ b/modules/stream_out/rtp.h
@@ -54,9 +54,9 @@ vlc_tick_t rtp_get_ts( const sout_stream_t *p_stream, const sout_stream_id_sys_t
                     vlc_tick_t *p_npt );
 
 /* RTP packetization */
-void rtp_packetize_common (sout_stream_id_sys_t *id, block_t *out,
+void rtp_packetize_common (sout_stream_id_sys_t *id, vlc_frame_t *out,
                            bool b_m_bit, vlc_tick_t i_pts);
-void rtp_packetize_send (sout_stream_id_sys_t *id, block_t *out);
+void rtp_packetize_send (sout_stream_id_sys_t *id, vlc_frame_t *out);
 size_t rtp_mtu (const sout_stream_id_sys_t *id);
 
 int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
@@ -67,9 +67,9 @@ typedef struct rtcp_sender_t rtcp_sender_t;
 rtcp_sender_t *OpenRTCP (vlc_object_t *obj, int rtp_fd, int proto,
                          bool mux);
 void CloseRTCP (rtcp_sender_t *rtcp);
-void SendRTCP (rtcp_sender_t *restrict rtcp, const block_t *rtp);
+void SendRTCP (rtcp_sender_t *restrict rtcp, const vlc_frame_t *rtp);
 
-typedef int (*pf_rtp_packetizer_t)( sout_stream_id_sys_t *, block_t * );
+typedef int (*pf_rtp_packetizer_t)( sout_stream_id_sys_t *, vlc_frame_t * );
 
 typedef struct rtp_format_t
 {
diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c
index 29032581fd..b606a467f7 100644
--- a/modules/stream_out/rtpfmt.c
+++ b/modules/stream_out/rtpfmt.c
@@ -29,7 +29,6 @@
 
 #include <vlc_common.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 #include <vlc_strings.h>
 
 #include "rtp.h"
@@ -38,30 +37,30 @@
 
 #include <assert.h>
 
-static int rtp_packetize_mpa  (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_mpv  (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_ac3  (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_simple(sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_split(sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_pcm(sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_swab (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_mp4a (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_mp4a_latm (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_h263 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_h264 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_h265 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_amr  (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_spx  (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_t140 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_g726_16 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_g726_24 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_g726_32 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_g726_40 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_xiph (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_vp8 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_jpeg (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_r420 (sout_stream_id_sys_t *, block_t *);
-static int rtp_packetize_rgb24 (sout_stream_id_sys_t *, block_t *);
+static int rtp_packetize_mpa  (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_mpv  (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_ac3  (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_simple(sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_split(sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_pcm(sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_swab (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_mp4a (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_mp4a_latm (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_h263 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_h264 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_h265 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_amr  (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_spx  (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_t140 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_g726_16 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_g726_24 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_g726_32 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_g726_40 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_xiph (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_vp8 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_jpeg (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_r420 (sout_stream_id_sys_t *, vlc_frame_t *);
+static int rtp_packetize_rgb24 (sout_stream_id_sys_t *, vlc_frame_t *);
 
 #define XIPH_IDENT (0)
 
@@ -717,7 +716,7 @@ int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
     for( int i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 18 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 18 + i_payload );
 
         unsigned fragtype, numpkts;
         if (i_count == 1)
@@ -760,7 +759,7 @@ int rtp_packetize_xiph_config( sout_stream_id_sys_t *id, const char *fmtp,
 }
 
 /* rfc5215 */
-static int rtp_packetize_xiph( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_xiph( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - 6; /* payload max in one packet */
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -771,7 +770,7 @@ static int rtp_packetize_xiph( sout_stream_id_sys_t *id, block_t *in )
     for( int i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 18 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 18 + i_payload );
 
         unsigned fragtype, numpkts;
         if (i_count == 1)
@@ -811,11 +810,11 @@ static int rtp_packetize_xiph( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_mpa( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_mpa( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - 4; /* payload max in one packet */
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -827,7 +826,7 @@ static int rtp_packetize_mpa( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 16 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 16 + i_payload );
 
         /* rtp common header */
         rtp_packetize_common( id, out, (i == i_count - 1)?1:0, in->i_pts );
@@ -846,12 +845,12 @@ static int rtp_packetize_mpa( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
 /* rfc2250 */
-static int rtp_packetize_mpv( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_mpv( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - 4; /* payload max in one packet */
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -905,7 +904,7 @@ static int rtp_packetize_mpv( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 16 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 16 + i_payload );
         /* MBZ:5 T:1 TR:10 AN:1 N:1 S:1 B:1 E:1 P:3 FBV:1 BFC:3 FFV:1 FFC:3 */
         uint32_t      h = ( i_temporal_ref << 16 )|
                           ( b_sequence_start << 13 )|
@@ -931,11 +930,11 @@ static int rtp_packetize_mpv( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_ac3( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_ac3( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - 2; /* payload max in one packet */
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -947,7 +946,7 @@ static int rtp_packetize_ac3( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 14 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 14 + i_payload );
 
         /* rtp common header */
         rtp_packetize_common( id, out, (i == i_count - 1)?1:0, in->i_pts );
@@ -967,15 +966,15 @@ static int rtp_packetize_ac3( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_simple(sout_stream_id_sys_t *id, block_t *block)
+static int rtp_packetize_simple(sout_stream_id_sys_t *id, vlc_frame_t *block)
 {
-    bool marker = (block->i_flags & BLOCK_FLAG_DISCONTINUITY) != 0;
+    bool marker = (block->i_flags & FRAME_FLAG_DISCONTINUITY) != 0;
 
-    block = block_Realloc(block, 12, block->i_buffer);
+    block = vlc_frame_Realloc(block, 12, block->i_buffer);
     if (unlikely(block == NULL))
         return VLC_ENOMEM;
 
@@ -984,7 +983,7 @@ static int rtp_packetize_simple(sout_stream_id_sys_t *id, block_t *block)
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_split( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_split( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id); /* payload max in one packet */
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -996,7 +995,7 @@ static int rtp_packetize_split( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 12 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 12 + i_payload );
 
         /* rtp common header */
         rtp_packetize_common( id, out, (i == i_count - 1),
@@ -1012,23 +1011,23 @@ static int rtp_packetize_split( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_pcm(sout_stream_id_sys_t *id, block_t *in)
+static int rtp_packetize_pcm(sout_stream_id_sys_t *id, vlc_frame_t *in)
 {
     unsigned max = rtp_mtu(id);
 
     while (in->i_buffer > max)
     {
         unsigned duration = (in->i_length * max) / in->i_buffer;
-        bool marker = (in->i_flags & BLOCK_FLAG_DISCONTINUITY) != 0;
+        bool marker = (in->i_flags & FRAME_FLAG_DISCONTINUITY) != 0;
 
-        block_t *out = block_Alloc(12 + max);
+        vlc_frame_t *out = vlc_frame_Alloc(12 + max);
         if (unlikely(out == NULL))
         {
-            block_Release(in);
+            vlc_frame_Release(in);
             return VLC_ENOMEM;
         }
 
@@ -1040,14 +1039,14 @@ static int rtp_packetize_pcm(sout_stream_id_sys_t *id, block_t *in)
         in->i_buffer -= max;
         in->i_pts += duration;
         in->i_length -= duration;
-        in->i_flags &= ~BLOCK_FLAG_DISCONTINUITY;
+        in->i_flags &= ~FRAME_FLAG_DISCONTINUITY;
     }
 
     return rtp_packetize_simple(id, in); /* zero copy for the last frame */
 }
 
 /* split and convert from little endian to network byte order */
-static int rtp_packetize_swab(sout_stream_id_sys_t *id, block_t *in)
+static int rtp_packetize_swab(sout_stream_id_sys_t *id, vlc_frame_t *in)
 {
     unsigned max = rtp_mtu(id);
 
@@ -1055,12 +1054,12 @@ static int rtp_packetize_swab(sout_stream_id_sys_t *id, block_t *in)
     {
         unsigned payload = (max < in->i_buffer) ? max : in->i_buffer;
         vlc_tick_t duration = (in->i_length * payload) / in->i_buffer;
-        bool marker = (in->i_flags & BLOCK_FLAG_DISCONTINUITY) != 0;
+        bool marker = (in->i_flags & FRAME_FLAG_DISCONTINUITY) != 0;
 
-        block_t *out = block_Alloc(12 + payload);
+        vlc_frame_t *out = vlc_frame_Alloc(12 + payload);
         if (unlikely(out == NULL))
         {
-            block_Release(in);
+            vlc_frame_Release(in);
             return VLC_ENOMEM;
         }
 
@@ -1072,15 +1071,15 @@ static int rtp_packetize_swab(sout_stream_id_sys_t *id, block_t *in)
         in->i_buffer -= payload;
         in->i_pts += duration;
         in->i_length -= duration;
-        in->i_flags &= ~BLOCK_FLAG_DISCONTINUITY;
+        in->i_flags &= ~FRAME_FLAG_DISCONTINUITY;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
 /* rfc3016 */
-static int rtp_packetize_mp4a_latm( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_mp4a_latm( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - 2;              /* payload max in one packet */
     int     latmhdrsize = in->i_buffer / 0xff + 1;
@@ -1093,11 +1092,11 @@ static int rtp_packetize_mp4a_latm( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int     i_payload = __MIN( i_max, i_data );
-        block_t *out;
+        vlc_frame_t *out;
 
         if( i != 0 )
             latmhdrsize = 0;
-        out = block_Alloc( 12 + latmhdrsize + i_payload );
+        out = vlc_frame_Alloc( 12 + latmhdrsize + i_payload );
 
         /* rtp common header */
         rtp_packetize_common( id, out, ((i == i_count - 1) ? 1 : 0),
@@ -1128,11 +1127,11 @@ static int rtp_packetize_mp4a_latm( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_mp4a( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_mp4a( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - 4; /* payload max in one packet */
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -1144,7 +1143,7 @@ static int rtp_packetize_mp4a( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 16 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 16 + i_payload );
 
         /* rtp common header */
         rtp_packetize_common( id, out, ((i == i_count - 1)?1:0),
@@ -1167,7 +1166,7 @@ static int rtp_packetize_mp4a( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1175,7 +1174,7 @@ static int rtp_packetize_mp4a( sout_stream_id_sys_t *id, block_t *in )
 /* rfc2429 */
 #define RTP_H263_HEADER_SIZE (2)  // plen = 0
 #define RTP_H263_PAYLOAD_START (14)  // plen = 0
-static int rtp_packetize_h263( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_h263( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     uint8_t *p_data = in->p_buffer;
     int     i_data  = in->i_buffer;
@@ -1190,12 +1189,12 @@ static int rtp_packetize_h263( sout_stream_id_sys_t *id, block_t *in )
 
     if( i_data < 2 )
     {
-        block_Release(in);
+        vlc_frame_Release(in);
         return VLC_EGENERIC;
     }
     if( p_data[0] || p_data[1] )
     {
-        block_Release(in);
+        vlc_frame_Release(in);
         return VLC_EGENERIC;
     }
     /* remove 2 leading 0 bytes */
@@ -1206,7 +1205,7 @@ static int rtp_packetize_h263( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int      i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( RTP_H263_PAYLOAD_START + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( RTP_H263_PAYLOAD_START + i_payload );
         b_p_bit = (i == 0) ? 1 : 0;
         h = ( b_p_bit << 10 )|
             ( b_v_bit << 9  )|
@@ -1231,7 +1230,7 @@ static int rtp_packetize_h263( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1255,7 +1254,7 @@ rtp_packetize_h264_nal( sout_stream_id_sys_t *id,
     if( i_data <= i_max )
     {
         /* Single NAL unit packet */
-        block_t *out = block_Alloc( 12 + i_data );
+        vlc_frame_t *out = vlc_frame_Alloc( 12 + i_data );
         out->i_dts    = i_dts;
         out->i_length = i_length;
 
@@ -1278,7 +1277,7 @@ rtp_packetize_h264_nal( sout_stream_id_sys_t *id,
         for( i = 0; i < i_count; i++ )
         {
             const int i_payload = __MIN( i_data, i_max-2 );
-            block_t *out = block_Alloc( 12 + 2 + i_payload );
+            vlc_frame_t *out = vlc_frame_Alloc( 12 + 2 + i_payload );
             out->i_dts    = i_dts + i * i_length / i_count;
             out->i_length = i_length / i_count;
 
@@ -1300,7 +1299,7 @@ rtp_packetize_h264_nal( sout_stream_id_sys_t *id,
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_h264( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_h264( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     hxxx_iterator_ctx_t it;
     hxxx_iterator_init( &it, in->p_buffer, in->i_buffer, 0 );
@@ -1315,7 +1314,7 @@ static int rtp_packetize_h264( sout_stream_id_sys_t *id, block_t *in )
                 it.p_head + 3 >= it.p_tail, in->i_length * i_nal / in->i_buffer );
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
@@ -1334,7 +1333,7 @@ rtp_packetize_h265_nal( sout_stream_id_sys_t *id,
     if( i_data <= i_max )
     {
         /* Single NAL unit packet */
-        block_t *out = block_Alloc( 12 + i_data );
+        vlc_frame_t *out = vlc_frame_Alloc( 12 + i_data );
         out->i_dts    = i_dts;
         out->i_length = i_length;
 
@@ -1359,7 +1358,7 @@ rtp_packetize_h265_nal( sout_stream_id_sys_t *id,
         for( size_t i = 0; i < i_count; i++ )
         {
             const size_t i_payload = __MIN( i_data, i_max-3 );
-            block_t *out = block_Alloc( 12 + 3 + i_payload );
+            vlc_frame_t *out = vlc_frame_Alloc( 12 + 3 + i_payload );
             out->i_dts    = i_dts + i * i_length / i_count;
             out->i_length = i_length / i_count;
 
@@ -1382,7 +1381,7 @@ rtp_packetize_h265_nal( sout_stream_id_sys_t *id,
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_h265( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_h265( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     hxxx_iterator_ctx_t it;
     hxxx_iterator_init( &it, in->p_buffer, in->i_buffer, 0 );
@@ -1396,11 +1395,11 @@ static int rtp_packetize_h265( sout_stream_id_sys_t *id, block_t *in )
                 it.p_head + 3 >= it.p_tail, in->i_length * i_nal / in->i_buffer );
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_amr( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_amr( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - 2; /* payload max in one packet */
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -1413,7 +1412,7 @@ static int rtp_packetize_amr( sout_stream_id_sys_t *id, block_t *in )
     for( i = 0; i < i_count; i++ )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 14 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 14 + i_payload );
 
         /* rtp common header */
         rtp_packetize_common( id, out, ((i == i_count - 1)?1:0),
@@ -1435,11 +1434,11 @@ static int rtp_packetize_amr( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_t140( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_t140( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     const size_t   i_max  = rtp_mtu (id);
     const uint8_t *p_data = in->p_buffer;
@@ -1459,17 +1458,17 @@ static int rtp_packetize_t140( sout_stream_id_sys_t *id, block_t *in )
             {
                 if( i_payload == 0 )
                  {
-                    block_Release(in);
+                    vlc_frame_Release(in);
                     return VLC_SUCCESS; /* fishy input! */
                 }
                 i_payload--;
             }
         }
 
-        block_t *out = block_Alloc( 12 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 12 + i_payload );
         if( out == NULL )
         {
-            block_Release(in);
+            vlc_frame_Release(in);
             return VLC_SUCCESS;
         }
 
@@ -1485,22 +1484,22 @@ static int rtp_packetize_t140( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
 
-static int rtp_packetize_spx( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_spx( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     uint8_t *p_buffer = in->p_buffer;
     int i_data_size, i_payload_size, i_payload_padding;
     i_data_size = i_payload_size = in->i_buffer;
     i_payload_padding = 0;
-    block_t *p_out;
+    vlc_frame_t *p_out;
 
     if ( in->i_buffer > rtp_mtu (id) )
     {
-        block_Release(in);
+        vlc_frame_Release(in);
         return VLC_SUCCESS;
     }
 
@@ -1523,7 +1522,7 @@ static int rtp_packetize_spx( sout_stream_id_sys_t *id, block_t *in )
       Allocate a new RTP p_output block of the appropriate size.
       Allow for 12 extra bytes of RTP header.
     */
-    p_out = block_Alloc( 12 + i_payload_size );
+    p_out = vlc_frame_Alloc( 12 + i_payload_size );
 
     if ( i_payload_padding )
     {
@@ -1560,14 +1559,14 @@ static int rtp_packetize_spx( sout_stream_id_sys_t *id, block_t *in )
 
     p_out->i_dts = in->i_dts;
     p_out->i_length = in->i_length;
-    block_Release(in);
+    vlc_frame_Release(in);
 
     /* Queue the buffer for actual transmission. */
     rtp_packetize_send( id, p_out );
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_g726( sout_stream_id_sys_t *id, block_t *in, int i_pad )
+static int rtp_packetize_g726( sout_stream_id_sys_t *id, vlc_frame_t *in, int i_pad )
 {
     int     i_max   = (rtp_mtu( id )- 12 + i_pad - 1) & ~i_pad;
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -1579,7 +1578,7 @@ static int rtp_packetize_g726( sout_stream_id_sys_t *id, block_t *in, int i_pad
     while( i_data > 0 )
     {
         int           i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( 12 + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 12 + i_payload );
 
         /* rtp common header */
         rtp_packetize_common( id, out, 0,
@@ -1596,26 +1595,26 @@ static int rtp_packetize_g726( sout_stream_id_sys_t *id, block_t *in, int i_pad
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_g726_16( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_g726_16( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     return rtp_packetize_g726( id, in, 4 );
 }
 
-static int rtp_packetize_g726_24( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_g726_24( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     return rtp_packetize_g726( id, in, 8 );
 }
 
-static int rtp_packetize_g726_32( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_g726_32( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     return rtp_packetize_g726( id, in, 2 );
 }
 
-static int rtp_packetize_g726_40( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_g726_40( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     return rtp_packetize_g726( id, in, 8 );
 }
@@ -1623,7 +1622,7 @@ static int rtp_packetize_g726_40( sout_stream_id_sys_t *id, block_t *in )
 #define RTP_VP8_HEADER_SIZE 1
 #define RTP_VP8_PAYLOAD_START (12 + RTP_VP8_HEADER_SIZE)
 
-static int rtp_packetize_vp8( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_vp8( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     int     i_max   = rtp_mtu (id) - RTP_VP8_HEADER_SIZE;
     int     i_count = ( in->i_buffer + i_max - 1 ) / i_max;
@@ -1633,17 +1632,17 @@ static int rtp_packetize_vp8( sout_stream_id_sys_t *id, block_t *in )
 
     if ( i_max <= 0 )
     {
-        block_Release(in);
+        vlc_frame_Release(in);
         return VLC_EGENERIC;
     }
 
     for( int i = 0; i < i_count; i++ )
     {
         int i_payload = __MIN( i_max, i_data );
-        block_t *out = block_Alloc( RTP_VP8_PAYLOAD_START + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( RTP_VP8_PAYLOAD_START + i_payload );
         if ( out == NULL )
         {
-            block_Release(in);
+            vlc_frame_Release(in);
             return VLC_ENOMEM;
         }
 
@@ -1668,12 +1667,12 @@ static int rtp_packetize_vp8( sout_stream_id_sys_t *id, block_t *in )
         i_data -= i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 }
 
 /* See RFC 4175 */
-static int rtp_packetize_rawvideo( sout_stream_id_sys_t *id, block_t *in, vlc_fourcc_t i_format  )
+static int rtp_packetize_rawvideo( sout_stream_id_sys_t *id, vlc_frame_t *in, vlc_fourcc_t i_format  )
 {
     int i_width, i_height;
     rtp_get_video_geometry( id, &i_width, &i_height );
@@ -1705,14 +1704,14 @@ static int rtp_packetize_rawvideo( sout_stream_id_sys_t *id, block_t *in, vlc_fo
         int i_payload = (int)(rtp_mtu (id) - RTP_HEADER_LEN);
         if( i_payload <= 0 )
         {
-            block_Release( in );
+            vlc_frame_Release( in );
             return VLC_EGENERIC;
         }
 
-        block_t *out = block_Alloc( RTP_HEADER_LEN + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( RTP_HEADER_LEN + i_payload );
         if( unlikely( out == NULL ) )
         {
-            block_Release( in );
+            vlc_frame_Release( in );
             return VLC_ENOMEM;
         }
 
@@ -1806,21 +1805,21 @@ static int rtp_packetize_rawvideo( sout_stream_id_sys_t *id, block_t *in, vlc_fo
         rtp_packetize_send( id, out );
     }
 
-    block_Release( in );
+    vlc_frame_Release( in );
     return VLC_SUCCESS;
 }
 
-static int rtp_packetize_r420( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_r420( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     return rtp_packetize_rawvideo( id, in, VLC_CODEC_R420 );
 }
 
-static int rtp_packetize_rgb24( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_rgb24( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     return rtp_packetize_rawvideo( id, in, VLC_CODEC_RGB24 );
 }
 
-static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
+static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, vlc_frame_t *in )
 {
     uint8_t *p_data = in->p_buffer;
     int      i_data = in->i_buffer;
@@ -1946,10 +1945,10 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
         if ( i_payload <= 0 )
             goto error;
 
-        block_t *out = block_Alloc( 12 + hdr_size + i_payload );
+        vlc_frame_t *out = vlc_frame_Alloc( 12 + hdr_size + i_payload );
         if( out == NULL )
         {
-            block_Release( in );
+            vlc_frame_Release( in );
             return VLC_ENOMEM;
         }
 
@@ -2002,9 +2001,9 @@ static int rtp_packetize_jpeg( sout_stream_id_sys_t *id, block_t *in )
         off    += i_payload;
     }
 
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_SUCCESS;
 error:
-    block_Release(in);
+    vlc_frame_Release(in);
     return VLC_EGENERIC;
 }
diff --git a/modules/stream_out/sdi/AES3Audio.cpp b/modules/stream_out/sdi/AES3Audio.cpp
index 8bf95a11fa..f3def8be56 100644
--- a/modules/stream_out/sdi/AES3Audio.cpp
+++ b/modules/stream_out/sdi/AES3Audio.cpp
@@ -32,14 +32,14 @@ AES3AudioBuffer::AES3AudioBuffer(vlc_object_t *p_obj, unsigned count)
 {
     obj = p_obj;
     setSubFramesCount(count);
-    block_BytestreamInit(&bytestream);
+    vlc_frame_BytestreamInit(&bytestream);
     toconsume = 0;
     i_codec = VLC_CODEC_S16N;
 }
 
 AES3AudioBuffer::~AES3AudioBuffer()
 {
-    block_BytestreamRelease(&bytestream);
+    vlc_frame_BytestreamRelease(&bytestream);
 }
 
 void AES3AudioBuffer::setSubFramesCount(uint8_t c)
@@ -47,10 +47,10 @@ void AES3AudioBuffer::setSubFramesCount(uint8_t c)
     buffersubframes = c;
 }
 
-void AES3AudioBuffer::push(block_t *p_block)
+void AES3AudioBuffer::push(vlc_frame_t *p_block)
 {
     bytestream_mutex.lock();
-    block_BytestreamPush(&bytestream, p_block);
+    vlc_frame_BytestreamPush(&bytestream, p_block);
     bytestream_mutex.unlock();
 }
 
@@ -85,7 +85,7 @@ unsigned AES3AudioBuffer::read(void *dstbuf, unsigned count, vlc_tick_t from,
     }
 
 #ifdef SDI_MULTIPLEX_DEBUG
-    unsigned inbuffer = BytesToFrames(block_BytestreamRemaining(&bytestream));
+    unsigned inbuffer = BytesToFrames(vlc_frame_BytestreamRemaining(&bytestream));
     msg_Dbg(obj, "%4.4s inbuffer %u count %u/%u skip %u pad %u",
             reinterpret_cast<const char *>(&i_codec), inbuffer, count, orig, skip, dstpad);
     assert(count + skip <= inbuffer);
@@ -105,7 +105,7 @@ unsigned AES3AudioBuffer::read(void *dstbuf, unsigned count, vlc_tick_t from,
                   GetWBE(&bytestream.p_block->p_buffer[4]) == 0xf872);
        }
        if(dst)
-            block_PeekOffsetBytes(&bytestream, srcoffset, &dst[dstoffset], sizeof(uint16_t));
+            vlc_frame_PeekOffsetBytes(&bytestream, srcoffset, &dst[dstoffset], sizeof(uint16_t));
     }
     bytestream_mutex.unlock();
 
@@ -150,10 +150,10 @@ void AES3AudioBuffer::flushConsumed()
     {
         size_t bytes = FramesToBytes(toconsume);
         bytestream_mutex.lock();
-        if(block_SkipBytes(&bytestream, bytes) == VLC_SUCCESS)
-            block_BytestreamFlush(&bytestream);
+        if(vlc_frame_SkipBytes(&bytestream, bytes) == VLC_SUCCESS)
+            vlc_frame_BytestreamFlush(&bytestream);
         else
-            block_BytestreamEmpty(&bytestream);
+            vlc_frame_BytestreamEmpty(&bytestream);
         bytestream_mutex.unlock();
 #ifdef SDI_MULTIPLEX_DEBUG
         msg_Dbg(obj, "%4.4s flushed off %zd -> pts %ld",
@@ -235,7 +235,7 @@ unsigned AES3AudioBuffer::availableVirtualSamples(vlc_tick_t from) const
 
     bytestream_mutex.lock();
     /* FIXME */
-    unsigned samples = BytesToFrames(block_BytestreamRemaining(&bytestream));
+    unsigned samples = BytesToFrames(vlc_frame_BytestreamRemaining(&bytestream));
     bytestream_mutex.unlock();
 
     int offset = OffsetToBufferStart(from);
diff --git a/modules/stream_out/sdi/AES3Audio.hpp b/modules/stream_out/sdi/AES3Audio.hpp
index c2c172d6ae..201287e915 100644
--- a/modules/stream_out/sdi/AES3Audio.hpp
+++ b/modules/stream_out/sdi/AES3Audio.hpp
@@ -21,8 +21,7 @@
 #define AES3AUDIO_HPP
 
 #include <vlc_common.h>
-#include <vlc_block.h>
-#include <vlc_block_helper.h>
+#include <vlc_frame_helper.h>
 #include <mutex>
 #include <vlc_es.h>
 
@@ -50,7 +49,7 @@ namespace sdi_sout
             vlc_tick_t bufferStart() const;
             unsigned availableVirtualSamples(vlc_tick_t) const;
             unsigned alignedInterleaveInSamples(vlc_tick_t, unsigned) const;
-            void push(block_t *);
+            void push(vlc_frame_t *);
             unsigned read(void *, unsigned, vlc_tick_t,
                           const AES3AudioSubFrameIndex &,
                           const AES3AudioSubFrameIndex &, unsigned);
@@ -68,7 +67,7 @@ namespace sdi_sout
             int OffsetToBufferStart(vlc_tick_t t) const;
             unsigned BytesToFrames(size_t) const;
             unsigned TicksDurationToFrames(vlc_tick_t) const;
-            block_bytestream_t bytestream;
+            vlc_frame_bytestream_t bytestream;
             mutable std::mutex bytestream_mutex;
             uint8_t buffersubframes;
             unsigned toconsume;
diff --git a/modules/stream_out/sdi/DBMSDIOutput.cpp b/modules/stream_out/sdi/DBMSDIOutput.cpp
index d54d2ce688..2d30d72bad 100644
--- a/modules/stream_out/sdi/DBMSDIOutput.cpp
+++ b/modules/stream_out/sdi/DBMSDIOutput.cpp
@@ -541,7 +541,7 @@ int DBMSDIOutput::Process()
         while(bufferStart <= p->date &&
               audioMultiplex->availableVirtualSamples(bufferStart) >= i_samples_per_frame)
         {
-            block_t *out = audioMultiplex->Extract(i_samples_per_frame);
+            vlc_frame_t *out = audioMultiplex->Extract(i_samples_per_frame);
             if(out)
             {
 #ifdef SDI_MULTIPLEX_DEBUG
@@ -555,48 +555,48 @@ int DBMSDIOutput::Process()
             i_samples_per_frame = audioMultiplex->alignedInterleaveInSamples(bufferStart, SAMPLES_PER_FRAME);
         }
 
-        ProcessVideo(p, reinterpret_cast<block_t *>(captionsBuffer.Dequeue()));
+        ProcessVideo(p, reinterpret_cast<vlc_frame_t *>(captionsBuffer.Dequeue()));
     }
 
     return VLC_SUCCESS;
 }
 
-int DBMSDIOutput::ProcessAudio(block_t *p_block)
+int DBMSDIOutput::ProcessAudio(vlc_frame_t *p_frame)
 {
     if(FAKE_DRIVER)
     {
-        block_Release(p_block);
+        vlc_frame_Release(p_frame);
         return VLC_SUCCESS;
     }
 
     if (!p_output)
     {
-        block_Release(p_block);
+        vlc_frame_Release(p_frame);
         return VLC_EGENERIC;
     }
 
-    p_block->i_pts -= offset;
+    p_frame->i_pts -= offset;
 
-    uint32_t sampleFrameCount = p_block->i_nb_samples;
+    uint32_t sampleFrameCount = p_frame->i_nb_samples;
     uint32_t written;
     HRESULT result = p_output->ScheduleAudioSamples(
-            p_block->p_buffer, p_block->i_nb_samples, p_block->i_pts, CLOCK_FREQ, &written);
+            p_frame->p_buffer, p_frame->i_nb_samples, p_frame->i_pts, CLOCK_FREQ, &written);
 
     if (result != S_OK)
         msg_Err(p_stream, "Failed to schedule audio sample: 0x%X", result);
     else
     {
-        lasttimestamp = __MAX(p_block->i_pts, lasttimestamp);
+        lasttimestamp = __MAX(p_frame->i_pts, lasttimestamp);
         if (sampleFrameCount != written)
             msg_Err(p_stream, "Written only %d samples out of %d", written, sampleFrameCount);
     }
 
-    block_Release(p_block);
+    vlc_frame_Release(p_frame);
 
     return result != S_OK ? VLC_EGENERIC : VLC_SUCCESS;
 }
 
-int DBMSDIOutput::ProcessVideo(picture_t *picture, block_t *p_cc)
+int DBMSDIOutput::ProcessVideo(picture_t *picture, vlc_frame_t *p_cc)
 {
     mtime_t now = vlc_tick_now();
 
@@ -619,7 +619,7 @@ int DBMSDIOutput::ProcessVideo(picture_t *picture, block_t *p_cc)
     return doProcessVideo(picture, p_cc);
 }
 
-int DBMSDIOutput::doProcessVideo(picture_t *picture, block_t *p_cc)
+int DBMSDIOutput::doProcessVideo(picture_t *picture, vlc_frame_t *p_cc)
 {
     HRESULT result;
     int w, h, stride, length, ret = VLC_EGENERIC;
@@ -721,7 +721,7 @@ end:
 
 error:
     if(p_cc)
-        block_Release(p_cc);
+        vlc_frame_Release(p_cc);
     picture_Release(picture);
     if (pDLVideoFrame)
         pDLVideoFrame->Release();
diff --git a/modules/stream_out/sdi/DBMSDIOutput.hpp b/modules/stream_out/sdi/DBMSDIOutput.hpp
index 95fe8bf9ce..ef01903894 100644
--- a/modules/stream_out/sdi/DBMSDIOutput.hpp
+++ b/modules/stream_out/sdi/DBMSDIOutput.hpp
@@ -38,8 +38,8 @@ namespace sdi_sout
             virtual int Process(); /* impl */
 
         protected:
-            int ProcessVideo(picture_t *, block_t *);
-            int ProcessAudio(block_t *);
+            int ProcessVideo(picture_t *, vlc_frame_t *);
+            int ProcessAudio(vlc_frame_t *);
             virtual int ConfigureVideo(const video_format_t *); /* impl */
             virtual int ConfigureAudio(const audio_format_t *); /* impl */
 
@@ -57,7 +57,7 @@ namespace sdi_sout
             const char *ErrorToString(long i_code);
             IDeckLinkDisplayMode * MatchDisplayMode(const video_format_t *,
                                                     BMDDisplayMode = bmdDisplayModeNotSupported);
-            int doProcessVideo(picture_t *, block_t *);
+            int doProcessVideo(picture_t *, vlc_frame_t *);
             picture_t * CreateNoSignalPicture(const char*, const video_format_t *);
     };
 }
diff --git a/modules/stream_out/sdi/SDIAudioMultiplex.cpp b/modules/stream_out/sdi/SDIAudioMultiplex.cpp
index a156cf735f..ee8aabe794 100644
--- a/modules/stream_out/sdi/SDIAudioMultiplex.cpp
+++ b/modules/stream_out/sdi/SDIAudioMultiplex.cpp
@@ -47,7 +47,7 @@ void SDIAudioMultiplexBuffer::FlushQueued()
 
 void SDIAudioMultiplexBuffer::Enqueue(void *p)
 {
-    AES3AudioBuffer::push(reinterpret_cast<block_t *>(p));
+    AES3AudioBuffer::push(reinterpret_cast<vlc_frame_t *>(p));
 }
 
 void * SDIAudioMultiplexBuffer::Dequeue()
@@ -449,7 +449,7 @@ void SDIAudioMultiplex::Debug() const
 }
 #endif
 
-block_t * SDIAudioMultiplex::Extract(unsigned samples)
+vlc_frame_t * SDIAudioMultiplex::Extract(unsigned samples)
 {
     vlc_tick_t start = bufferStart();
 
@@ -466,13 +466,13 @@ block_t * SDIAudioMultiplex::Extract(unsigned samples)
         start = head;
     }
 
-    block_t *p_block = block_Alloc( interleavedframes * 2 * sizeof(uint16_t) * samples );
-    if(!p_block)
+    vlc_frame_t *p_frame = vlc_frame_Alloc( interleavedframes * 2 * sizeof(uint16_t) * samples );
+    if(!p_frame)
         return NULL;
-    memset(p_block->p_buffer, 0, p_block->i_buffer);
+    memset(p_frame->p_buffer, 0, p_frame->i_buffer);
 
-    p_block->i_pts = p_block->i_dts = start;
-    p_block->i_nb_samples = samples;
+    p_frame->i_pts = p_frame->i_dts = start;
+    p_frame->i_nb_samples = samples;
 
     for(unsigned i=0; i<MAX_AES3_AUDIO_FRAMES; i++)
     {
@@ -488,8 +488,8 @@ block_t * SDIAudioMultiplex::Extract(unsigned samples)
                 start, source->bufferStartTime(), ahead);
 #endif
 
-        source->subframe0.copy(p_block->p_buffer, samples, start, (i * 2 + 0), interleavedframes);
-        source->subframe1.copy(p_block->p_buffer, samples, start, (i * 2 + 1), interleavedframes);
+        source->subframe0.copy(p_frame->p_buffer, samples, start, (i * 2 + 0), interleavedframes);
+        source->subframe1.copy(p_frame->p_buffer, samples, start, (i * 2 + 1), interleavedframes);
     }
 
 
@@ -500,5 +500,5 @@ block_t * SDIAudioMultiplex::Extract(unsigned samples)
 
     head = bufferStart();
 
-    return p_block;
+    return p_frame;
 }
diff --git a/modules/stream_out/sdi/SDIAudioMultiplex.hpp b/modules/stream_out/sdi/SDIAudioMultiplex.hpp
index ea9f2d26d8..148be3c0c5 100644
--- a/modules/stream_out/sdi/SDIAudioMultiplex.hpp
+++ b/modules/stream_out/sdi/SDIAudioMultiplex.hpp
@@ -93,7 +93,7 @@ namespace sdi_sout
             vlc_tick_t bufferStart() const;
             unsigned availableVirtualSamples(vlc_tick_t) const;
             unsigned alignedInterleaveInSamples(vlc_tick_t, unsigned) const;
-            block_t * Extract(unsigned);
+            vlc_frame_t * Extract(unsigned);
             unsigned getFreeSubFrameSlots() const;
             void SetSubFrameSource(uint8_t, AES3AudioBuffer *, AES3AudioSubFrameIndex);
 #ifdef SDI_MULTIPLEX_DEBUG
diff --git a/modules/stream_out/sdi/SDIOutput.cpp b/modules/stream_out/sdi/SDIOutput.cpp
index 2bb3de98e3..e3d5ff732c 100644
--- a/modules/stream_out/sdi/SDIOutput.cpp
+++ b/modules/stream_out/sdi/SDIOutput.cpp
@@ -142,7 +142,7 @@ AbstractStream *SDIOutput::Add(const es_format_t *fmt)
     return s;
 }
 
-int SDIOutput::Send(AbstractStream *id, block_t *p)
+int SDIOutput::Send(AbstractStream *id, vlc_frame_t *p)
 {
     int ret = id->Send(p);
     Process();
@@ -217,10 +217,10 @@ void SDIOutput::SoutCallback_Del(sout_stream_t *p_stream, void *id)
     me->Del(reinterpret_cast<AbstractStream *>(id));
 }
 
-int SDIOutput::SoutCallback_Send(sout_stream_t *p_stream, void *id, block_t *p_block)
+int SDIOutput::SoutCallback_Send(sout_stream_t *p_stream, void *id, vlc_frame_t *p_frame)
 {
     SDIOutput *me = reinterpret_cast<SDIOutput *>(p_stream->p_sys);
-    return me->Send(reinterpret_cast<AbstractStream *>(id), p_block);
+    return me->Send(reinterpret_cast<AbstractStream *>(id), p_frame);
 }
 
 int SDIOutput::SoutCallback_Control(sout_stream_t *p_stream, int query, va_list args)
diff --git a/modules/stream_out/sdi/SDIOutput.hpp b/modules/stream_out/sdi/SDIOutput.hpp
index c21f5b09e9..bb1409e0c4 100644
--- a/modules/stream_out/sdi/SDIOutput.hpp
+++ b/modules/stream_out/sdi/SDIOutput.hpp
@@ -36,7 +36,7 @@ namespace sdi_sout
             virtual int Open() = 0;
             virtual int Process() = 0;
             virtual AbstractStream *Add(const es_format_t *);
-            virtual int   Send(AbstractStream *, block_t *);
+            virtual int   Send(AbstractStream *, vlc_frame_t *);
             virtual void  Del(AbstractStream *);
             virtual int   Control(int, va_list);
 
@@ -81,7 +81,7 @@ namespace sdi_sout
         private:
             static void *SoutCallback_Add(sout_stream_t *, const es_format_t *);
             static void  SoutCallback_Del(sout_stream_t *, void *);
-            static int   SoutCallback_Send(sout_stream_t *, void *, block_t*);
+            static int   SoutCallback_Send(sout_stream_t *, void *, vlc_frame_t*);
             static int   SoutCallback_Control(sout_stream_t *, int, va_list);
             static void  SoutCallback_Flush(sout_stream_t *, void *);
     };
diff --git a/modules/stream_out/sdi/SDIStream.cpp b/modules/stream_out/sdi/SDIStream.cpp
index 5202bd331c..b666e128f5 100644
--- a/modules/stream_out/sdi/SDIStream.cpp
+++ b/modules/stream_out/sdi/SDIStream.cpp
@@ -26,7 +26,6 @@
 
 #include <vlc_modules.h>
 #include <vlc_meta.h>
-#include <vlc_block.h>
 
 #include <sstream>
 
@@ -73,9 +72,9 @@ BlockStreamOutputBuffer::~BlockStreamOutputBuffer()
 
 void BlockStreamOutputBuffer::FlushQueued()
 {
-    block_t *p;
-    while((p = reinterpret_cast<block_t *>(Dequeue())))
-        block_Release(p);
+    vlc_frame_t *p;
+    while((p = reinterpret_cast<vlc_frame_t *>(Dequeue())))
+        vlc_frame_Release(p);
 }
 
 
@@ -229,7 +228,7 @@ bool AbstractDecodedStream::init(const es_format_t *p_fmt)
     return true;
 }
 
-int AbstractDecodedStream::Send(block_t *p_block)
+int AbstractDecodedStream::Send(vlc_frame_t *p_block)
 {
     assert(p_decoder);
 
@@ -249,7 +248,7 @@ int AbstractDecodedStream::Send(block_t *p_block)
             case VLCDEC_RELOAD:
                 p_owner->b_error = true;
                 if(p_block)
-                    block_Release(p_block);
+                    vlc_frame_Release(p_block);
                 break;
             default:
                 vlc_assert_unreachable();
@@ -312,7 +311,7 @@ void VideoDecodedStream::VideoDecCallback_queue(decoder_t *p_dec, picture_t *p_p
     static_cast<VideoDecodedStream *>(p_owner->id)->Output(p_pic);
 }
 
-void VideoDecodedStream::VideoDecCallback_queue_cc(decoder_t *p_dec, block_t *p_block,
+void VideoDecodedStream::VideoDecCallback_queue_cc(decoder_t *p_dec, vlc_frame_t *p_block,
                                                    const decoder_cc_desc_t *)
 {
     struct decoder_owner *p_owner;
@@ -413,7 +412,7 @@ void VideoDecodedStream::Output(picture_t *p_pic)
         outputbuffer->Enqueue(p_pic);
 }
 
-void VideoDecodedStream::QueueCC(block_t *p_block)
+void VideoDecodedStream::QueueCC(vlc_frame_t *p_block)
 {
     captionsOutputBuffer->Enqueue(p_block);
 }
@@ -432,14 +431,14 @@ AudioDecodedStream::~AudioDecodedStream()
         aout_FiltersDelete(p_stream, p_filters);
 }
 
-void AudioDecodedStream::AudioDecCallback_queue(decoder_t *p_dec, block_t *p_block)
+void AudioDecodedStream::AudioDecCallback_queue(decoder_t *p_dec, vlc_frame_t *p_block)
 {
     struct decoder_owner *p_owner;
     p_owner = container_of(p_dec, struct decoder_owner, dec);
     static_cast<AudioDecodedStream *>(p_owner->id)->Output(p_block);
 }
 
-void AudioDecodedStream::Output(block_t *p_block)
+void AudioDecodedStream::Output(vlc_frame_t *p_block)
 {
     struct decoder_owner *p_owner;
     p_owner = container_of(p_decoder, struct decoder_owner, dec);
@@ -456,7 +455,7 @@ void AudioDecodedStream::Output(block_t *p_block)
         if(!p_filters)
         {
             msg_Err(p_stream, "filter creation failed");
-            block_Release(p_block);
+            vlc_frame_Release(p_block);
             return;
         }
 
@@ -526,12 +525,12 @@ AbstractRawStream::~AbstractRawStream()
     FlushQueued();
 }
 
-int AbstractRawStream::Send(block_t *p_block)
+int AbstractRawStream::Send(vlc_frame_t *p_block)
 {
     if(p_block->i_buffer)
         outputbuffer->Enqueue(p_block);
     else
-        block_Release(p_block);
+        vlc_frame_Release(p_block);
     return VLC_SUCCESS;
 }
 
@@ -547,9 +546,9 @@ void AbstractRawStream::Drain()
 
 void AbstractRawStream::FlushQueued()
 {
-    block_t *p;
-    while((p = reinterpret_cast<block_t *>(outputbuffer->Dequeue())))
-        block_Release(p);
+    vlc_frame_t *p;
+    while((p = reinterpret_cast<vlc_frame_t *>(outputbuffer->Dequeue())))
+        vlc_frame_Release(p);
 }
 
 
@@ -565,7 +564,7 @@ AbstractReorderedStream::~AbstractReorderedStream()
 {
 }
 
-int AbstractReorderedStream::Send(block_t *p_block)
+int AbstractReorderedStream::Send(vlc_frame_t *p_block)
 {
     auto it = reorder.begin();
     if(do_reorder)
@@ -627,11 +626,11 @@ AudioCompressedStream::~AudioCompressedStream()
 {
 }
 
-int AudioCompressedStream::Send(block_t *p_block)
+int AudioCompressedStream::Send(vlc_frame_t *p_block)
 {
     const size_t i_payload = p_block->i_buffer;
     const size_t i_pad = (p_block->i_buffer & 1) ? 1 : 0;
-    p_block = block_Realloc(p_block, 12, p_block->i_buffer + i_pad);
+    p_block = vlc_frame_Realloc(p_block, 12, p_block->i_buffer + i_pad);
     if(!p_block)
         return VLC_EGENERIC;
     /* Convert to AES3 Payload */
diff --git a/modules/stream_out/sdi/SDIStream.hpp b/modules/stream_out/sdi/SDIStream.hpp
index 09ef279915..45172fddc8 100644
--- a/modules/stream_out/sdi/SDIStream.hpp
+++ b/modules/stream_out/sdi/SDIStream.hpp
@@ -90,7 +90,7 @@ namespace sdi_sout
                            AbstractStreamOutputBuffer *);
             virtual ~AbstractStream();
             virtual bool init(const es_format_t *) = 0;
-            virtual int Send(block_t*) = 0;
+            virtual int Send(vlc_frame_t*) = 0;
             virtual void Drain() = 0;
             virtual void Flush() = 0;
             const StreamID & getID() const;
@@ -110,7 +110,7 @@ namespace sdi_sout
                                   AbstractStreamOutputBuffer *);
             virtual ~AbstractDecodedStream();
             virtual bool init(const es_format_t *); /* impl */
-            virtual int Send(block_t*);
+            virtual int Send(vlc_frame_t*);
             virtual void Flush();
             virtual void Drain();
             void setOutputFormat(const es_format_t *);
@@ -132,13 +132,13 @@ namespace sdi_sout
 
         private:
             static void VideoDecCallback_queue(decoder_t *, picture_t *);
-            static void VideoDecCallback_queue_cc( decoder_t *, block_t *,
+            static void VideoDecCallback_queue_cc( decoder_t *, vlc_frame_t *,
                                                    const decoder_cc_desc_t * );
             static int VideoDecCallback_update_format(decoder_t *);
             static picture_t *VideoDecCallback_new_buffer(decoder_t *);
             filter_chain_t * VideoFilterCreate(const es_format_t *);
             void Output(picture_t *);
-            void QueueCC(block_t *);
+            void QueueCC(vlc_frame_t *);
             filter_chain_t *p_filters_chain;
             AbstractStreamOutputBuffer *captionsOutputBuffer;
     };
@@ -152,10 +152,10 @@ namespace sdi_sout
             virtual void setCallbacks();
 
         private:
-            static void AudioDecCallback_queue(decoder_t *, block_t *);
+            static void AudioDecCallback_queue(decoder_t *, vlc_frame_t *);
             static int AudioDecCallback_update_format(decoder_t *);
             aout_filters_t *AudioFiltersCreate(const es_format_t *);
-            void Output(block_t *);
+            void Output(vlc_frame_t *);
             aout_filters_t *p_filters;
     };
 
@@ -165,7 +165,7 @@ namespace sdi_sout
             AbstractRawStream(vlc_object_t *, const StreamID &,
                               AbstractStreamOutputBuffer *);
             virtual ~AbstractRawStream();
-            virtual int Send(block_t*); /* impl */
+            virtual int Send(vlc_frame_t*); /* impl */
             virtual void Flush(); /* impl */
             virtual void Drain(); /* impl */
 
@@ -179,13 +179,13 @@ namespace sdi_sout
             AbstractReorderedStream(vlc_object_t *, const StreamID &,
                                     AbstractStreamOutputBuffer *);
             virtual ~AbstractReorderedStream();
-            virtual int Send(block_t*); /* impl */
+            virtual int Send(vlc_frame_t*); /* impl */
             virtual void Flush(); /* impl */
             virtual void Drain(); /* impl */
             void setReorder(size_t);
 
         protected:
-            std::list<block_t *> reorder;
+            std::list<vlc_frame_t *> reorder;
             size_t reorder_depth;
             bool do_reorder;
     };
@@ -196,7 +196,7 @@ namespace sdi_sout
             AudioCompressedStream(vlc_object_t *, const StreamID &,
                                   AbstractStreamOutputBuffer *);
             virtual ~AudioCompressedStream();
-            virtual int Send(block_t*); /* reimpl */
+            virtual int Send(vlc_frame_t*); /* reimpl */
             virtual bool init(const es_format_t *); /* impl */
     };
 
diff --git a/modules/stream_out/setid.c b/modules/stream_out/setid.c
index 208f7e5028..64f31b4559 100644
--- a/modules/stream_out/setid.c
+++ b/modules/stream_out/setid.c
@@ -98,7 +98,7 @@ static const char *ppsz_sout_options_lang[] = {
 static void *AddId  ( sout_stream_t *, const es_format_t * );
 static void *AddLang( sout_stream_t *, const es_format_t * );
 static void  Del    ( sout_stream_t *, void * );
-static int   Send   ( sout_stream_t *, void *, block_t * );
+static int   Send   ( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct
 {
@@ -229,7 +229,7 @@ static void Del( sout_stream_t *p_stream, void *id )
     sout_StreamIdDel( p_stream->p_next, id );
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     return sout_StreamIdSend( p_stream->p_next, id, p_buffer );
 }
diff --git a/modules/stream_out/smem.c b/modules/stream_out/smem.c
index be462be205..2205abf69b 100644
--- a/modules/stream_out/smem.c
+++ b/modules/stream_out/smem.c
@@ -49,7 +49,6 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 #include <vlc_codec.h>
 #include <vlc_aout.h>
 
@@ -126,13 +125,13 @@ static const char *const ppsz_sout_options[] = {
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 static void *AddVideo( sout_stream_t *p_stream, const es_format_t *p_fmt );
 static void *AddAudio( sout_stream_t *p_stream, const es_format_t *p_fmt );
 
-static int SendVideo( sout_stream_t *p_stream, void *id, block_t *p_buffer );
-static int SendAudio( sout_stream_t *p_stream, void *id, block_t *p_buffer );
+static int SendVideo( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer );
+static int SendAudio( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer );
 
 typedef struct
 {
@@ -343,7 +342,7 @@ static void Del( sout_stream_t *p_stream, void *_id )
     free( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
     if ( id->format.i_cat == VIDEO_ES )
@@ -353,7 +352,7 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     return VLC_SUCCESS;
 }
 
-static int SendVideo( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int SendVideo( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
@@ -366,7 +365,7 @@ static int SendVideo( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     if (!p_pixels)
     {
         msg_Err( p_stream, "No buffer given!" );
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
         return VLC_EGENERIC;
     }
 
@@ -376,11 +375,11 @@ static int SendVideo( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     p_sys->pf_video_postrender_callback( id->p_data, p_pixels,
                                          id->format.video.i_width, id->format.video.i_height,
                                          id->format.video.i_bits_per_pixel, i_size, p_buffer->i_pts );
-    block_ChainRelease( p_buffer );
+    vlc_frame_ChainRelease( p_buffer );
     return VLC_SUCCESS;
 }
 
-static int SendAudio( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int SendAudio( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
@@ -392,7 +391,7 @@ static int SendAudio( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     if (id->format.audio.i_channels == 0)
     {
         msg_Warn( p_stream, "No buffer given!" );
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
         return VLC_EGENERIC;
     }
 
@@ -402,7 +401,7 @@ static int SendAudio( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     if (!p_pcm_buffer)
     {
         msg_Err( p_stream, "No buffer given!" );
-        block_ChainRelease( p_buffer );
+        vlc_frame_ChainRelease( p_buffer );
         return VLC_EGENERIC;
     }
 
@@ -412,7 +411,7 @@ static int SendAudio( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     p_sys->pf_audio_postrender_callback( id->p_data, p_pcm_buffer,
                                          id->format.audio.i_channels, id->format.audio.i_rate, i_samples,
                                          id->format.audio.i_bitspersample, i_size, p_buffer->i_pts );
-    block_ChainRelease( p_buffer );
+    vlc_frame_ChainRelease( p_buffer );
     return VLC_SUCCESS;
 }
 
diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index 3a36e7b394..c4180a93e1 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -141,7 +141,7 @@ static void Del( sout_stream_t *p_stream, void *id )
     sout_MuxDeleteStream( p_sys->p_mux, (sout_input_t*)id );
 }
 
-static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
     return sout_MuxSendBuffer( p_sys->p_mux, (sout_input_t*)id, p_buffer );
diff --git a/modules/stream_out/stats.c b/modules/stream_out/stats.c
index 05beb06966..c00208d40a 100644
--- a/modules/stream_out/stats.c
+++ b/modules/stream_out/stats.c
@@ -30,7 +30,7 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
 #include <vlc_md5.h>
 #include <vlc_fs.h>
 
@@ -69,7 +69,7 @@ static const char *ppsz_sout_options[] = {
 
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 typedef struct
 {
@@ -210,18 +210,18 @@ static void Del( sout_stream_t *p_stream, void *_id )
     free( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
     struct md5_s hash;
 
-    block_t *p_block = p_buffer;
-    while ( p_block != NULL )
+    vlc_frame_t *p_frame = p_buffer;
+    while ( p_frame != NULL )
     {
         InitMD5( &hash );
-        AddMD5( &hash, p_block->p_buffer, p_block->i_buffer );
-        AddMD5( &id->hash, p_block->p_buffer, p_block->i_buffer );
+        AddMD5( &hash, p_frame->p_buffer, p_frame->i_buffer );
+        AddMD5( &id->hash, p_frame->p_buffer, p_frame->i_buffer );
         EndMD5( &hash );
         char *outputhash = psz_md5_hash( &hash );
 
@@ -230,28 +230,28 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
          */
         vlc_tick_t dts_difference = VLC_TICK_INVALID;
         if( likely( id->previous_dts != VLC_TICK_INVALID ) )
-            dts_difference = p_block->i_dts - id->previous_dts;
+            dts_difference = p_frame->i_dts - id->previous_dts;
         if( p_sys->output )
         {
             /* Write data in a form that it's easy to plot for example with gnuplot*/
             fprintf( p_sys->output, "%s\t%d\t%s\t%"PRIu64"\t%"PRId64"\t%"PRId64"\t%16s\n",
                   p_sys->prefix, id->id, id->type, ++id->segment_number, dts_difference,
-                  p_block->i_length, outputhash );
+                  p_frame->i_length, outputhash );
 
         } else {
             msg_Dbg( p_stream, "%s: track:%d type:%s segment_number:%"PRIu64" dts_difference:%"PRId64" length:%"PRId64" md5:%16s",
                   p_sys->prefix, id->id, id->type, ++id->segment_number, dts_difference,
-                  p_block->i_length, outputhash );
+                  p_frame->i_length, outputhash );
         }
-        id->track_duration += p_block->i_length ? p_block->i_length : dts_difference;
+        id->track_duration += p_frame->i_length ? p_frame->i_length : dts_difference;
         free( outputhash );
-        id->previous_dts = p_block->i_dts;
-        p_block = p_block->p_next;
+        id->previous_dts = p_frame->i_dts;
+        p_frame = p_frame->p_next;
     }
 
     if( p_stream->p_next )
         return sout_StreamIdSend( p_stream->p_next, id->next_id, p_buffer );
     else
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
     return VLC_SUCCESS;
 }
diff --git a/modules/stream_out/transcode/audio.c b/modules/stream_out/transcode/audio.c
index bf1b5d772d..e4c94fa4c0 100644
--- a/modules/stream_out/transcode/audio.c
+++ b/modules/stream_out/transcode/audio.c
@@ -76,7 +76,7 @@ static int transcode_audio_filters_init( sout_stream_t *p_stream,
     return ( *pp_chain != NULL ) ? VLC_SUCCESS : VLC_EGENERIC;
 }
 
-static void decoder_queue_audio( decoder_t *p_dec, block_t *p_audio )
+static void decoder_queue_audio( decoder_t *p_dec, vlc_frame_t *p_audio )
 {
     struct decoder_owner *p_owner = dec_get_owner( p_dec );
     sout_stream_id_sys_t *id = p_owner->id;
@@ -87,10 +87,10 @@ static void decoder_queue_audio( decoder_t *p_dec, block_t *p_audio )
     vlc_mutex_unlock(&id->fifo.lock);
 }
 
-static block_t *transcode_dequeue_all_audios( sout_stream_id_sys_t *id )
+static vlc_frame_t *transcode_dequeue_all_audios( sout_stream_id_sys_t *id )
 {
     vlc_mutex_lock(&id->fifo.lock);
-    block_t *p_audio_bufs = id->fifo.audio.first;
+    vlc_frame_t *p_audio_bufs = id->fifo.audio.first;
     id->fifo.audio.first = NULL;
     id->fifo.audio.last = &id->fifo.audio.first;
     vlc_mutex_unlock(&id->fifo.lock);
@@ -222,7 +222,7 @@ static bool transcode_audio_format_IsSimilar( const audio_format_t *a,
 
 int transcode_audio_process( sout_stream_t *p_stream,
                                     sout_stream_id_sys_t *id,
-                                    block_t *in, block_t **out )
+                                    vlc_frame_t *in, vlc_frame_t **out )
 {
     *out = NULL;
 
@@ -230,11 +230,11 @@ int transcode_audio_process( sout_stream_t *p_stream,
     if( ret != VLCDEC_SUCCESS )
         return VLC_EGENERIC;
 
-    block_t *p_audio_bufs = transcode_dequeue_all_audios( id );
+    vlc_frame_t *p_audio_bufs = transcode_dequeue_all_audios( id );
 
     do
     {
-        block_t *p_audio_buf = p_audio_bufs;
+        vlc_frame_t *p_audio_buf = p_audio_bufs;
         if( p_audio_buf == NULL )
             break;
         p_audio_bufs = p_audio_buf->p_next;
@@ -242,7 +242,7 @@ int transcode_audio_process( sout_stream_t *p_stream,
 
         if( id->b_error )
         {
-            block_Release( p_audio_buf );
+            vlc_frame_Release( p_audio_buf );
             continue;
         }
 
@@ -332,14 +332,14 @@ int transcode_audio_process( sout_stream_t *p_stream,
         {
             p_audio_buf->i_dts = p_audio_buf->i_pts;
 
-            block_t *p_block = transcode_encoder_encode( id->encoder, p_audio_buf );
-            block_ChainAppend( out, p_block );
-            block_Release( p_audio_buf );
+            vlc_frame_t *p_frame = transcode_encoder_encode( id->encoder, p_audio_buf );
+            vlc_frame_ChainAppend( out, p_frame );
+            vlc_frame_Release( p_audio_buf );
         }
         continue;
 error:
         if( p_audio_buf )
-            block_Release( p_audio_buf );
+            vlc_frame_Release( p_audio_buf );
         id->b_error = true;
     } while( p_audio_bufs );
 
diff --git a/modules/stream_out/transcode/encoder/audio.c b/modules/stream_out/transcode/encoder/audio.c
index d45f7a066c..cdd57eef99 100644
--- a/modules/stream_out/transcode/encoder/audio.c
+++ b/modules/stream_out/transcode/encoder/audio.c
@@ -204,17 +204,17 @@ int transcode_encoder_audio_test( vlc_object_t *p_obj,
     return p_module != NULL ? VLC_SUCCESS : VLC_EGENERIC;
 }
 
-block_t * transcode_encoder_audio_encode( transcode_encoder_t *p_enc, block_t *p_block )
+vlc_frame_t * transcode_encoder_audio_encode( transcode_encoder_t *p_enc, vlc_frame_t *p_frame )
 {
-    return p_enc->p_encoder->pf_encode_audio( p_enc->p_encoder, p_block );
+    return p_enc->p_encoder->pf_encode_audio( p_enc->p_encoder, p_frame );
 }
 
-int transcode_encoder_audio_drain( transcode_encoder_t *p_enc, block_t **out )
+int transcode_encoder_audio_drain( transcode_encoder_t *p_enc, vlc_frame_t **out )
 {
-    block_t *p_block;
+    vlc_frame_t *p_frame;
     do {
-        p_block = transcode_encoder_audio_encode( p_enc, NULL );
-        block_ChainAppend( out, p_block );
-    } while( p_block );
+        p_frame = transcode_encoder_audio_encode( p_enc, NULL );
+        vlc_frame_ChainAppend( out, p_frame );
+    } while( p_frame );
     return VLC_SUCCESS;
 }
diff --git a/modules/stream_out/transcode/encoder/encoder.c b/modules/stream_out/transcode/encoder/encoder.c
index 2cc0bf6e88..7d6b7145e0 100644
--- a/modules/stream_out/transcode/encoder/encoder.c
+++ b/modules/stream_out/transcode/encoder/encoder.c
@@ -48,7 +48,7 @@ void transcode_encoder_delete( transcode_encoder_t *p_enc )
     {
         if( p_enc->p_encoder->fmt_in.i_cat == VIDEO_ES )
         {
-            block_ChainRelease( p_enc->p_buffers );
+            vlc_frame_ChainRelease( p_enc->p_buffers );
             picture_fifo_Delete( p_enc->pp_pics );
             vlc_mutex_destroy( &p_enc->lock_out );
         }
@@ -141,7 +141,7 @@ bool transcode_encoder_opened( const transcode_encoder_t *p_enc )
     return p_enc->p_encoder && p_enc->p_encoder->p_module;
 }
 
-block_t * transcode_encoder_encode( transcode_encoder_t *p_enc, void *in )
+vlc_frame_t * transcode_encoder_encode( transcode_encoder_t *p_enc, void *in )
 {
     switch( p_enc->p_encoder->fmt_in.i_cat )
     {
@@ -157,10 +157,10 @@ block_t * transcode_encoder_encode( transcode_encoder_t *p_enc, void *in )
     }
 }
 
-block_t * transcode_encoder_get_output_async( transcode_encoder_t *p_enc )
+vlc_frame_t * transcode_encoder_get_output_async( transcode_encoder_t *p_enc )
 {
     vlc_mutex_lock( &p_enc->lock_out );
-    block_t *p_data = p_enc->p_buffers;
+    vlc_frame_t *p_data = p_enc->p_buffers;
     p_enc->p_buffers = NULL;
     vlc_mutex_unlock( &p_enc->lock_out );
     return p_data;
@@ -201,7 +201,7 @@ int transcode_encoder_open( transcode_encoder_t *p_enc,
     }
 }
 
-int transcode_encoder_drain( transcode_encoder_t *p_enc, block_t **out )
+int transcode_encoder_drain( transcode_encoder_t *p_enc, vlc_frame_t **out )
 {
     if( !transcode_encoder_opened( p_enc ) )
         return VLC_EGENERIC;
diff --git a/modules/stream_out/transcode/encoder/encoder.h b/modules/stream_out/transcode/encoder/encoder.h
index 00827502e7..8a2ae4c9bb 100644
--- a/modules/stream_out/transcode/encoder/encoder.h
+++ b/modules/stream_out/transcode/encoder/encoder.h
@@ -68,15 +68,15 @@ const es_format_t *transcode_encoder_format_out( const transcode_encoder_t * );
 void transcode_encoder_update_format_in( transcode_encoder_t *, const es_format_t * );
 void transcode_encoder_update_format_out( transcode_encoder_t *, const es_format_t * );
 
-block_t * transcode_encoder_encode( transcode_encoder_t *, void * );
-block_t * transcode_encoder_get_output_async( transcode_encoder_t * );
+vlc_frame_t * transcode_encoder_encode( transcode_encoder_t *, void * );
+vlc_frame_t * transcode_encoder_get_output_async( transcode_encoder_t * );
 void transcode_encoder_delete( transcode_encoder_t * );
 transcode_encoder_t * transcode_encoder_new( vlc_object_t *, const es_format_t * );
 void transcode_encoder_close( transcode_encoder_t * );
 
 bool transcode_encoder_opened( const transcode_encoder_t * );
 int transcode_encoder_open( transcode_encoder_t *, const transcode_encoder_config_t * );
-int transcode_encoder_drain( transcode_encoder_t *, block_t ** );
+int transcode_encoder_drain( transcode_encoder_t *, vlc_frame_t ** );
 
 int transcode_encoder_test( vlc_object_t *p_obj,
                             const transcode_encoder_config_t *p_cfg,
diff --git a/modules/stream_out/transcode/encoder/encoder_priv.h b/modules/stream_out/transcode/encoder/encoder_priv.h
index 2875ae71a4..df17f5d668 100644
--- a/modules/stream_out/transcode/encoder/encoder_priv.h
+++ b/modules/stream_out/transcode/encoder/encoder_priv.h
@@ -29,7 +29,7 @@ struct transcode_encoder_t
     vlc_cond_t      cond;
 
     /* output buffers */
-    block_t         *p_buffers;
+    vlc_frame_t         *p_buffers;
     bool b_threaded;
 };
 
@@ -42,12 +42,12 @@ int transcode_encoder_spu_open( transcode_encoder_t *p_enc,
 
 void transcode_encoder_video_close( transcode_encoder_t *p_enc );
 
-block_t * transcode_encoder_video_encode( transcode_encoder_t *p_enc, picture_t *p_pic );
-block_t * transcode_encoder_audio_encode( transcode_encoder_t *p_enc, block_t *p_block );
-block_t * transcode_encoder_spu_encode( transcode_encoder_t *p_enc, subpicture_t *p_spu );
+vlc_frame_t * transcode_encoder_video_encode( transcode_encoder_t *p_enc, picture_t *p_pic );
+vlc_frame_t * transcode_encoder_audio_encode( transcode_encoder_t *p_enc, vlc_frame_t *p_block );
+vlc_frame_t * transcode_encoder_spu_encode( transcode_encoder_t *p_enc, subpicture_t *p_spu );
 
-int transcode_encoder_audio_drain( transcode_encoder_t *p_enc, block_t **out );
-int transcode_encoder_video_drain( transcode_encoder_t *p_enc, block_t **out );
+int transcode_encoder_audio_drain( transcode_encoder_t *p_enc, vlc_frame_t **out );
+int transcode_encoder_video_drain( transcode_encoder_t *p_enc, vlc_frame_t **out );
 
 int transcode_encoder_video_test( vlc_object_t *p_obj,
                                   const transcode_encoder_config_t *p_cfg,
diff --git a/modules/stream_out/transcode/encoder/spu.c b/modules/stream_out/transcode/encoder/spu.c
index 45f4bdf57e..cbecfdc756 100644
--- a/modules/stream_out/transcode/encoder/spu.c
+++ b/modules/stream_out/transcode/encoder/spu.c
@@ -47,7 +47,7 @@ int transcode_encoder_spu_open( transcode_encoder_t *p_enc,
     return ( p_enc->p_encoder->p_module ) ? VLC_SUCCESS: VLC_EGENERIC;
 }
 
-block_t * transcode_encoder_spu_encode( transcode_encoder_t *p_enc, subpicture_t *p_spu )
+vlc_frame_t * transcode_encoder_spu_encode( transcode_encoder_t *p_enc, subpicture_t *p_spu )
 {
     return p_enc->p_encoder->pf_encode_sub( p_enc->p_encoder, p_spu );
 }
diff --git a/modules/stream_out/transcode/encoder/video.c b/modules/stream_out/transcode/encoder/video.c
index 062f89838a..d89c85c1d0 100644
--- a/modules/stream_out/transcode/encoder/video.c
+++ b/modules/stream_out/transcode/encoder/video.c
@@ -330,7 +330,7 @@ static void* EncoderThread( void *obj )
     transcode_encoder_t *p_enc = obj;
     picture_t *p_pic = NULL;
     int canc = vlc_savecancel ();
-    block_t *p_block = NULL;
+    vlc_frame_t *p_frame = NULL;
 
     vlc_mutex_lock( &p_enc->lock_out );
 
@@ -345,11 +345,11 @@ static void* EncoderThread( void *obj )
         {
             /* release lock while encoding */
             vlc_mutex_unlock( &p_enc->lock_out );
-            p_block = p_enc->p_encoder->pf_encode_video( p_enc->p_encoder, p_pic );
+            p_frame = p_enc->p_encoder->pf_encode_video( p_enc->p_encoder, p_pic );
             picture_Release( p_pic );
             vlc_mutex_lock( &p_enc->lock_out );
 
-            block_ChainAppend( &p_enc->p_buffers, p_block );
+            vlc_frame_ChainAppend( &p_enc->p_buffers, p_frame );
         }
 
         if( p_enc->b_abort )
@@ -360,16 +360,16 @@ static void* EncoderThread( void *obj )
     while( (p_pic = picture_fifo_Pop( p_enc->pp_pics )) != NULL )
     {
         vlc_sem_post( &p_enc->picture_pool_has_room );
-        p_block = p_enc->p_encoder->pf_encode_video( p_enc->p_encoder, p_pic );
+        p_frame = p_enc->p_encoder->pf_encode_video( p_enc->p_encoder, p_pic );
         picture_Release( p_pic );
-        block_ChainAppend( &p_enc->p_buffers, p_block );
+        vlc_frame_ChainAppend( &p_enc->p_buffers, p_frame );
     }
 
     /*Now flush encoder*/
     do {
-        p_block = p_enc->p_encoder->pf_encode_video(p_enc->p_encoder, NULL );
-        block_ChainAppend( &p_enc->p_buffers, p_block );
-    } while( p_block );
+        p_frame = p_enc->p_encoder->pf_encode_video(p_enc->p_encoder, NULL );
+        vlc_frame_ChainAppend( &p_enc->p_buffers, p_frame );
+    } while( p_frame );
 
     vlc_mutex_unlock( &p_enc->lock_out );
 
@@ -378,15 +378,15 @@ static void* EncoderThread( void *obj )
     return NULL;
 }
 
-int transcode_encoder_video_drain( transcode_encoder_t *p_enc, block_t **out )
+int transcode_encoder_video_drain( transcode_encoder_t *p_enc, vlc_frame_t **out )
 {
     if( !p_enc->b_threaded )
     {
-        block_t *p_block;
+        vlc_frame_t *p_frame;
         do {
-            p_block = transcode_encoder_encode( p_enc, NULL );
-            block_ChainAppend( out, p_block );
-        } while( p_block );
+            p_frame = transcode_encoder_encode( p_enc, NULL );
+            vlc_frame_ChainAppend( out, p_frame );
+        } while( p_frame );
     }
     else
     {
@@ -398,7 +398,7 @@ int transcode_encoder_video_drain( transcode_encoder_t *p_enc, block_t **out )
             vlc_mutex_unlock( &p_enc->lock_out );
             vlc_join( p_enc->thread, NULL );
         }
-        block_ChainAppend( out, transcode_encoder_get_output_async( p_enc ) );
+        vlc_frame_ChainAppend( out, transcode_encoder_get_output_async( p_enc ) );
     }
     return VLC_SUCCESS;
 }
@@ -460,7 +460,7 @@ int transcode_encoder_video_open( transcode_encoder_t *p_enc,
     return VLC_SUCCESS;
 }
 
-block_t * transcode_encoder_video_encode( transcode_encoder_t *p_enc, picture_t *p_pic )
+vlc_frame_t * transcode_encoder_video_encode( transcode_encoder_t *p_enc, picture_t *p_pic )
 {
     if( !p_enc->b_threaded )
     {
diff --git a/modules/stream_out/transcode/spu.c b/modules/stream_out/transcode/spu.c
index 83426d1d69..5245da1520 100644
--- a/modules/stream_out/transcode/spu.c
+++ b/modules/stream_out/transcode/spu.c
@@ -170,7 +170,7 @@ void transcode_spu_clean( sout_stream_t *p_stream, sout_stream_id_sys_t *id)
 
 int transcode_spu_process( sout_stream_t *p_stream,
                                   sout_stream_id_sys_t *id,
-                                  block_t *in, block_t **out )
+                                  vlc_frame_t *in, vlc_frame_t **out )
 {
     VLC_UNUSED(p_stream);
     *out = NULL;
@@ -216,7 +216,7 @@ int transcode_spu_process( sout_stream_t *p_stream,
         }
         else
         {
-            block_t *p_block;
+            vlc_frame_t *p_frame;
 
             es_format_t fmt;
             es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_TEXT );
@@ -241,10 +241,10 @@ int transcode_spu_process( sout_stream_t *p_stream,
             subpicture_Update( p_subpic, &fmt.video, &fmt.video, p_subpic->i_start );
             es_format_Clean( &fmt );
 
-            p_block = transcode_encoder_encode( id->encoder, p_subpic );
+            p_frame = transcode_encoder_encode( id->encoder, p_subpic );
             subpicture_Delete( p_subpic );
-            if( p_block )
-                block_ChainAppend( out, p_block );
+            if( p_frame )
+                vlc_frame_ChainAppend( out, p_frame );
             else
                 b_error = true;
         }
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index 786d649513..f935c93428 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -232,7 +232,7 @@ static const char *const ppsz_sout_options[] = {
  *****************************************************************************/
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
-static int   Send( sout_stream_t *, void *, block_t * );
+static int   Send( sout_stream_t *, void *, vlc_frame_t * );
 
 static void SetAudioEncoderConfig( sout_stream_t *p_stream, transcode_encoder_config_t *p_cfg )
 {
@@ -697,10 +697,10 @@ static void Del( sout_stream_t *p_stream, void *_id )
     DeleteSoutStreamID( id );
 }
 
-static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
+static int Send( sout_stream_t *p_stream, void *_id, vlc_frame_t *p_buffer )
 {
     sout_stream_id_sys_t *id = (sout_stream_id_sys_t *)_id;
-    block_t *p_out = NULL;
+    vlc_frame_t *p_out = NULL;
 
     if( id->b_error )
         goto error;
@@ -739,6 +739,6 @@ static int Send( sout_stream_t *p_stream, void *_id, block_t *p_buffer )
     return i_ret;
 error:
     if( p_buffer )
-        block_Release( p_buffer );
+        vlc_frame_Release( p_buffer );
     return VLC_EGENERIC;
 }
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index adb2b635f8..3463e1e546 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -93,8 +93,8 @@ struct sout_stream_id_sys_t
                 subpicture_t **last;
             } spu;
             struct {
-                block_t *first;
-                block_t **last;
+                vlc_frame_t *first;
+                vlc_frame_t **last;
             } audio;
         };
     } fifo;
@@ -174,14 +174,14 @@ static inline void es_format_SetMeta( es_format_t *p_dst, const es_format_t *p_s
 
 void transcode_spu_clean  ( sout_stream_t *, sout_stream_id_sys_t * );
 int  transcode_spu_process( sout_stream_t *, sout_stream_id_sys_t *,
-                                   block_t *, block_t ** );
+                                   vlc_frame_t *, vlc_frame_t ** );
 int  transcode_spu_init   ( sout_stream_t *, const es_format_t *, sout_stream_id_sys_t *);
 
 /* AUDIO */
 
 void transcode_audio_clean  ( sout_stream_t *, sout_stream_id_sys_t * );
 int  transcode_audio_process( sout_stream_t *, sout_stream_id_sys_t *,
-                                     block_t *, block_t ** );
+                                     vlc_frame_t *, vlc_frame_t ** );
 int  transcode_audio_init   ( sout_stream_t *, const es_format_t *,
                               sout_stream_id_sys_t *);
 
@@ -189,7 +189,7 @@ int  transcode_audio_init   ( sout_stream_t *, const es_format_t *,
 
 void transcode_video_clean  ( sout_stream_t *, sout_stream_id_sys_t * );
 int  transcode_video_process( sout_stream_t *, sout_stream_id_sys_t *,
-                                     block_t *, block_t ** );
+                                     vlc_frame_t *, vlc_frame_t ** );
 int transcode_video_get_output_dimensions( sout_stream_t *, sout_stream_id_sys_t *,
                                            unsigned *w, unsigned *h );
 void transcode_video_push_spu( sout_stream_t *, sout_stream_id_sys_t *, subpicture_t * );
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index ef64cf7539..85ab9daa03 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -408,9 +408,9 @@ static picture_t * RenderSubpictures( sout_stream_t *p_stream, sout_stream_id_sy
     return p_pic;
 }
 
-static void tag_last_block_with_flag( block_t **out, int i_flag )
+static void tag_last_frame_with_flag( vlc_frame_t **out, int i_flag )
 {
-    block_t *p_last = *out;
+    vlc_frame_t *p_last = *out;
     if( p_last )
     {
         while( p_last->p_next )
@@ -420,11 +420,11 @@ static void tag_last_block_with_flag( block_t **out, int i_flag )
 }
 
 int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
-                                    block_t *in, block_t **out )
+                                    vlc_frame_t *in, vlc_frame_t **out )
 {
     *out = NULL;
 
-    const bool b_eos = in && (in->i_flags & BLOCK_FLAG_END_OF_SEQUENCE);
+    const bool b_eos = in && (in->i_flags & FRAME_FLAG_END_OF_SEQUENCE);
 
     int ret = id->p_decoder->pf_decode( id->p_decoder, in );
     if( ret != VLCDEC_SUCCESS )
@@ -545,9 +545,9 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
 
                 if( p_in )
                 {
-                    block_t *p_encoded = transcode_encoder_encode( id->encoder, p_in );
+                    vlc_frame_t *p_encoded = transcode_encoder_encode( id->encoder, p_in );
                     if( p_encoded )
-                        block_ChainAppend( out, p_encoded );
+                        vlc_frame_ChainAppend( out, p_encoded );
                     picture_Release( p_in );
                 }
             }
@@ -560,7 +560,7 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
                 goto error;
             transcode_encoder_close( id->encoder );
             if( b_eos )
-                tag_last_block_with_flag( out, BLOCK_FLAG_END_OF_SEQUENCE );
+                tag_last_frame_with_flag( out, FRAME_FLAG_END_OF_SEQUENCE );
         }
 
         continue;
@@ -573,7 +573,7 @@ error:
     if( id->p_enccfg->video.threads.i_count >= 1 )
     {
         /* Pick up any return data the encoder thread wants to output. */
-        block_ChainAppend( out, transcode_encoder_get_output_async( id->encoder ) );
+        vlc_frame_ChainAppend( out, transcode_encoder_get_output_async( id->encoder ) );
     }
 
     /* Drain encoder */
@@ -587,7 +587,7 @@ error:
     }
 
     if( b_eos )
-        tag_last_block_with_flag( out, BLOCK_FLAG_END_OF_SEQUENCE );
+        tag_last_frame_with_flag( out, FRAME_FLAG_END_OF_SEQUENCE );
 
     return id->b_error ? VLC_EGENERIC : VLC_SUCCESS;
 }
diff --git a/modules/stream_out/vod.c b/modules/stream_out/vod.c
index 042894c84f..e7a7bc6636 100644
--- a/modules/stream_out/vod.c
+++ b/modules/stream_out/vod.c
@@ -31,10 +31,10 @@
 #endif
 
 #include <vlc_common.h>
+#include <vlc_data.h>
 #include <vlc_plugin.h>
 #include <vlc_input.h>
 #include <vlc_sout.h>
-#include <vlc_block.h>
 
 #include <vlc_vod.h>
 #include <vlc_url.h>
@@ -81,7 +81,7 @@ typedef struct
 
     /* */
     vlc_thread_t thread;
-    block_fifo_t *p_fifo_cmd;
+    vlc_data_fifo_t *p_fifo_cmd;
 } vod_sys_t;
 
 /* rtsp delayed command (to avoid deadlock between vlm/httpd) */
@@ -152,11 +152,11 @@ int OpenVoD( vlc_object_t *p_this )
     p_vod->pf_media_new = MediaNew;
     p_vod->pf_media_del = MediaAskDel;
 
-    p_sys->p_fifo_cmd = block_FifoNew();
+    p_sys->p_fifo_cmd = vlc_data_FifoNew();
     if( vlc_clone( &p_sys->thread, CommandThread, p_vod, VLC_THREAD_PRIORITY_LOW ) )
     {
         msg_Err( p_vod, "cannot spawn rtsp vod thread" );
-        block_FifoRelease( p_sys->p_fifo_cmd );
+        vlc_data_FifoRelease( p_sys->p_fifo_cmd );
         goto error;
     }
 
@@ -184,17 +184,17 @@ void CloseVoD( vlc_object_t * p_this )
     vlc_cancel( p_sys->thread );
     vlc_join( p_sys->thread, NULL );
 
-    while( block_FifoCount( p_sys->p_fifo_cmd ) > 0 )
+    while( vlc_data_FifoCount( p_sys->p_fifo_cmd ) > 0 )
     {
         rtsp_cmd_t cmd;
-        block_t *p_block_cmd = block_FifoGet( p_sys->p_fifo_cmd );
+        vlc_data_t *p_block_cmd = vlc_data_FifoGet( p_sys->p_fifo_cmd );
         memcpy( &cmd, p_block_cmd->p_buffer, sizeof(cmd) );
-        block_Release( p_block_cmd );
+        vlc_data_Release( p_block_cmd );
         if ( cmd.i_type == RTSP_CMD_TYPE_DEL )
             MediaDel(p_vod, cmd.p_media);
         free( cmd.psz_arg );
     }
-    block_FifoRelease( p_sys->p_fifo_cmd );
+    vlc_data_FifoRelease( p_sys->p_fifo_cmd );
 
     free( p_sys->psz_rtsp_path );
     free( p_sys );
@@ -328,7 +328,7 @@ static void CommandPush( vod_t *p_vod, rtsp_cmd_type_t i_type,
                          vod_media_t *p_media, const char *psz_arg )
 {
     rtsp_cmd_t cmd;
-    block_t *p_cmd;
+    vlc_data_t *p_cmd;
 
     cmd.i_type = i_type;
     cmd.p_media = p_media;
@@ -337,11 +337,11 @@ static void CommandPush( vod_t *p_vod, rtsp_cmd_type_t i_type,
     else
         cmd.psz_arg = NULL;
 
-    p_cmd = block_Alloc( sizeof(rtsp_cmd_t) );
+    p_cmd = vlc_data_Alloc( sizeof(rtsp_cmd_t) );
     memcpy( p_cmd->p_buffer, &cmd, sizeof(cmd) );
 
     vod_sys_t *p_sys = p_vod->p_sys;
-    block_FifoPut( p_sys->p_fifo_cmd, p_cmd );
+    vlc_data_FifoPut( p_sys->p_fifo_cmd, p_cmd );
 }
 
 static void* CommandThread( void *obj )
@@ -351,7 +351,7 @@ static void* CommandThread( void *obj )
 
     for( ;; )
     {
-        block_t *p_block_cmd = block_FifoGet( p_sys->p_fifo_cmd );
+        vlc_data_t *p_block_cmd = vlc_data_FifoGet( p_sys->p_fifo_cmd );
         rtsp_cmd_t cmd;
 
         if( !p_block_cmd )
@@ -359,7 +359,7 @@ static void* CommandThread( void *obj )
 
         int canc = vlc_savecancel ();
         memcpy( &cmd, p_block_cmd->p_buffer, sizeof(cmd) );
-        block_Release( p_block_cmd );
+        vlc_data_Release( p_block_cmd );
 
         /* */
         switch( cmd.i_type )
-- 
2.20.1



More information about the vlc-devel mailing list