Changeset 298f0e468edf5cbbf05d852bb58c7ef762a6a571

Show
Ignore:
Timestamp:
11/03/04 18:35:28 (5 years ago)
Author:
Laurent Aimar <fenrir@videolan.org>
git-committer:
Laurent Aimar <fenrir@videolan.org> 1079026528 +0000
git-parent:

[1007fd93863262b3df3a066928ca7137fae9c46b]

git-author:
Laurent Aimar <fenrir@videolan.org> 1079026528 +0000
Message:
  • access_output: sout_buffer_t -> block_t.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/access_output/dummy.c

    r7211d64 r298f0e4  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: dummy.c,v 1.3 2003/03/03 14:21:08 gbazin Exp
     5 * $Id
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    2727 *****************************************************************************/ 
    2828#include <stdlib.h> 
    29 #include <sys/types.h> 
    30 #include <sys/stat.h> 
    31 #include <string.h> 
    32 #include <errno.h> 
    33 #include <fcntl.h> 
    3429 
    3530#include <vlc/vlc.h> 
    36 #include <vlc/input.h> 
    3731#include <vlc/sout.h> 
    38  
    39 #ifdef HAVE_UNISTD_H 
    40 #   include <unistd.h> 
    41 #endif 
    42  
    43 /***************************************************************************** 
    44  * Exported prototypes 
    45  *****************************************************************************/ 
    46 static int     Open   ( vlc_object_t * ); 
    47 static void    Close  ( vlc_object_t * ); 
    48  
    49 static int     Write( sout_access_out_t *, sout_buffer_t * ); 
    50 static int     Seek ( sout_access_out_t *, off_t  ); 
    5132 
    5233/***************************************************************************** 
    5334 * Module descriptor 
    5435 *****************************************************************************/ 
     36static int  Open ( vlc_object_t * ); 
     37static void Close( vlc_object_t * ); 
     38 
    5539vlc_module_begin(); 
    5640    set_description( _("Dummy stream ouput") ); 
     
    6044vlc_module_end(); 
    6145 
     46 
     47/***************************************************************************** 
     48 * Exported prototypes 
     49 *****************************************************************************/ 
     50static int     Write( sout_access_out_t *, block_t * ); 
     51static int     Seek ( sout_access_out_t *, off_t  ); 
    6252 
    6353/***************************************************************************** 
     
    7262    p_access->pf_seek  = Seek; 
    7363 
    74     msg_Info( p_access, "dummy stream output access launched" ); 
     64    msg_Dbg( p_access, "dummy stream output access opened" ); 
    7565    return VLC_SUCCESS; 
    7666} 
     
    8272{ 
    8373    sout_access_out_t   *p_access = (sout_access_out_t*)p_this; 
    84     msg_Info( p_access, "Close" ); 
     74    msg_Dbg( p_access, "dummy stream output access closed" ); 
    8575} 
    8676 
     
    8878 * Read: standard read on a file descriptor. 
    8979 *****************************************************************************/ 
    90 static int Write( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) 
     80static int Write( sout_access_out_t *p_access, block_t *p_buffer ) 
    9181{ 
    92     size_t i_write = 0; 
     82    int64_t i_write = 0; 
     83    block_t *b = p_buffer; 
    9384 
    94     do 
     85    while( b ) 
    9586    { 
    96         sout_buffer_t *p_next; 
    97         i_write += p_buffer->i_size; 
    98         p_next = p_buffer->p_next; 
    99         sout_BufferDelete( p_access->p_sout, p_buffer ); 
    100         p_buffer = p_next; 
    101     } while( p_buffer ); 
     87        i_write += b->i_buffer; 
    10288 
    103     msg_Dbg( p_access, "Dummy Skipped: len:"I64Fd, (int64_t)i_write ); 
     89        b = b->p_next; 
     90    } 
    10491 
    105     return( i_write ); 
     92    block_ChainRelease( p_buffer ); 
     93 
     94    return i_write; 
    10695} 
    10796 
     
    111100static int Seek( sout_access_out_t *p_access, off_t i_pos ) 
    112101{ 
    113     msg_Dbg( p_access, "Seek: pos:"I64Fd, (int64_t)i_pos ); 
    114     return( 0 ); 
     102    return 0; 
    115103} 
    116104 
  • modules/access_output/file.c

    r5c2cf08 r298f0e4  
    33 ***************************************************************************** 
    44 * Copyright (C) 2001, 2002 VideoLAN 
    5  * $Id: file.c,v 1.11 2004/01/23 17:56:14 gbazin Exp
     5 * $Id
    66 * 
    77 * Authors: Laurent Aimar <fenrir@via.ecp.fr> 
     
    3030#include <sys/stat.h> 
    3131#include <string.h> 
     32#include <fcntl.h> 
    3233#include <errno.h> 
    33 #include <fcntl.h> 
    3434 
    3535#include <vlc/vlc.h> 
    36 #include <vlc/input.h> 
    3736#include <vlc/sout.h> 
    3837 
     
    5554 
    5655/***************************************************************************** 
    57  * Exported prototypes 
    58  *****************************************************************************/ 
    59 static int     Open   ( vlc_object_t * ); 
    60 static void    Close  ( vlc_object_t * ); 
    61  
    62 static int     Write( sout_access_out_t *, sout_buffer_t * ); 
    63 static int     Seek ( sout_access_out_t *, off_t  ); 
    64 static int     Read ( sout_access_out_t *, sout_buffer_t * ); 
    65  
    66 /***************************************************************************** 
    6756 * Module descriptor 
    6857 *****************************************************************************/ 
     58static int  Open ( vlc_object_t * ); 
     59static void Close( vlc_object_t * ); 
     60 
    6961vlc_module_begin(); 
    7062    set_description( _("File stream ouput") ); 
     
    7466vlc_module_end(); 
    7567 
     68 
     69/***************************************************************************** 
     70 * Exported prototypes 
     71 *****************************************************************************/ 
     72static int Write( sout_access_out_t *, block_t * ); 
     73static int Seek ( sout_access_out_t *, off_t  ); 
     74static int Read ( sout_access_out_t *, block_t * ); 
     75 
    7676struct sout_access_out_sys_t 
    7777{ 
    7878    int i_handle; 
    79  
    8079}; 
    8180 
     
    126125    p_access->pf_seek  = Seek; 
    127126 
    128     msg_Info( p_access, "Open: name:`%s'", p_access->psz_name ); 
     127    msg_Dbg( p_access, "file access output opened (`%s')", p_access->psz_name ); 
    129128    return VLC_SUCCESS; 
    130129} 
     
    146145    free( p_access->p_sys ); 
    147146 
    148     msg_Info( p_access, "Close" ); 
     147    msg_Dbg( p_access, "file access output closed" ); 
    149148} 
    150149 
     
    152151 * Read: standard read on a file descriptor. 
    153152 *****************************************************************************/ 
    154 static int Read( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) 
     153static int Read( sout_access_out_t *p_access, block_t *p_buffer ) 
    155154{ 
    156155    if( strcmp( p_access->psz_name, "-" ) ) 
    157156    { 
    158157        return read( p_access->p_sys->i_handle, p_buffer->p_buffer, 
    159                      p_buffer->i_size ); 
    160     } 
    161     else 
    162     { 
    163         msg_Err( p_access, "cannot seek while using stdout" ); 
    164         return VLC_EGENERIC; 
    165     } 
     158                     p_buffer->i_buffer ); 
     159    } 
     160 
     161    msg_Err( p_access, "cannot read while using stdout" ); 
     162    return VLC_EGENERIC; 
    166163} 
    167164 
     
    169166 * Write: standard write on a file descriptor. 
    170167 *****************************************************************************/ 
    171 static int Write( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) 
     168static int Write( sout_access_out_t *p_access, block_t *p_buffer ) 
    172169{ 
    173170    size_t i_write = 0; 
    174171 
    175     do 
    176     { 
    177         sout_buffer_t *p_next
    178  
    179         i_write += write( p_access->p_sys->i_handle, p_buffer->p_buffer, 
    180                           p_buffer->i_size ); 
    181         p_next = p_buffer->p_next
    182         sout_BufferDelete( p_access->p_sout, p_buffer ); 
     172    while( p_buffer ) 
     173    { 
     174        block_t *p_next = p_buffer->p_next;
     175 
     176        i_write += write( p_access->p_sys->i_handle, 
     177                          p_buffer->p_buffer, p_buffer->i_buffer ); 
     178        block_Release( p_buffer )
     179 
    183180        p_buffer = p_next; 
    184  
    185     } while( p_buffer ); 
    186  
    187     return( i_write ); 
     181    } 
     182 
     183    return i_write; 
    188184} 
    189185 
     
    193189static int Seek( sout_access_out_t *p_access, off_t i_pos ) 
    194190{ 
    195     //msg_Dbg( p_access, "Seek: pos:"I64Fd, (int64_t)i_pos ); 
    196  
    197191    if( strcmp( p_access->psz_name, "-" ) ) 
    198192    { 
  • modules/access_output/http.c

    r4c29602 r298f0e4  
    2626 *****************************************************************************/ 
    2727#include <stdlib.h> 
    28 #include <string.h> 
    29 #include <errno.h> 
    3028 
    3129#include <vlc/vlc.h> 
    32 #include <vlc/input.h> 
    3330#include <vlc/sout.h> 
    3431 
     
    4037 
    4138/***************************************************************************** 
    42  * Exported prototypes 
    43  *****************************************************************************/ 
    44 static int     Open   ( vlc_object_t * ); 
    45 static void    Close  ( vlc_object_t * ); 
    46  
    47 static int     Write( sout_access_out_t *, sout_buffer_t * ); 
    48 static int     Seek ( sout_access_out_t *, off_t  ); 
    49  
    50 /***************************************************************************** 
    5139 * Module descriptor 
    5240 *****************************************************************************/ 
     41static int  Open ( vlc_object_t * ); 
     42static void Close( vlc_object_t * ); 
     43 
    5344vlc_module_begin(); 
    5445    set_description( _("HTTP stream ouput") ); 
     
    5950vlc_module_end(); 
    6051 
     52 
     53/***************************************************************************** 
     54 * Exported prototypes 
     55 *****************************************************************************/ 
     56static int Write( sout_access_out_t *, block_t * ); 
     57static int Seek ( sout_access_out_t *, off_t  ); 
     58 
    6159struct sout_access_out_sys_t 
    6260{ 
     
    7472}; 
    7573 
    76 #if 0 
    77 static struct 
    78 { 
    79     char *psz_ext; 
    80     char *psz_mime; 
    81 } http_mime[] = 
    82 { 
    83     { ".avi",   "video/avi" }, 
    84     { ".asf",   "video/x-ms-asf" }, 
    85     { ".m1a",   "audio/mpeg" }, 
    86     { ".m2a",   "audio/mpeg" }, 
    87     { ".m1v",   "video/mpeg" }, 
    88     { ".m2v",   "video/mpeg" }, 
    89     { ".mp2",   "audio/mpeg" }, 
    90     { ".mp3",   "audio/mpeg" }, 
    91     { ".mpa",   "audio/mpeg" }, 
    92     { ".mpg",   "video/mpeg" }, 
    93     { ".mpeg",  "video/mpeg" }, 
    94     { ".mpe",   "video/mpeg" }, 
    95     { ".mov",   "video/quicktime" }, 
    96     { ".moov",  "video/quicktime" }, 
    97     { ".ogg",   "application/ogg" }, 
    98     { ".ogm",   "application/ogg" }, 
    99     { ".wma",   "audio/x-ms-wma" }, 
    100     { ".wmv",   "video/x-ms-wmv" }, 
    101     { ".wav",   "audio/wav" }, 
    102     { NULL,     NULL } 
    103 }; 
    104  
    105 static char *GetMime( char *psz_name ) 
    106 { 
    107     char *psz_ext; 
    108  
    109     psz_ext = strrchr( psz_name, '.' ); 
    110     if( psz_ext ) 
    111     { 
    112         int i; 
    113  
    114         for( i = 0; http_mime[i].psz_ext != NULL ; i++ ) 
    115         { 
    116             if( !strcmp( http_mime[i].psz_ext, psz_ext ) ) 
    117             { 
    118                 return( http_mime[i].psz_mime ); 
    119             } 
    120         } 
    121     } 
    122     return( "application/octet-stream" ); 
    123 } 
    124 #endif 
    125  
    12674/***************************************************************************** 
    12775 * Open: open the file 
     
    273221 * Write: 
    274222 *****************************************************************************/ 
    275 static int Write( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) 
     223static int Write( sout_access_out_t *p_access, block_t *p_buffer ) 
    276224{ 
    277225    sout_access_out_sys_t *p_sys = p_access->p_sys; 
     
    280228    while( p_buffer ) 
    281229    { 
    282         sout_buffer_t *p_next; 
    283  
    284         if( p_buffer->i_flags & SOUT_BUFFER_FLAGS_HEADER ) 
     230        block_t *p_next; 
     231 
     232        if( p_buffer->i_flags & BLOCK_FLAG_HEADER ) 
    285233        { 
    286234            /* gather header */ 
     
    291239                p_sys->b_header_complete = VLC_FALSE; 
    292240            } 
    293             if( (int)(p_buffer->i_size + p_sys->i_header_size) > 
     241            if( (int)(p_buffer->i_buffer + p_sys->i_header_size) > 
    294242                p_sys->i_header_allocated ) 
    295243            { 
    296244                p_sys->i_header_allocated = 
    297                     p_buffer->i_size + p_sys->i_header_size + 1024; 
     245                    p_buffer->i_buffer + p_sys->i_header_size + 1024; 
    298246                p_sys->p_header = 
    299247                    realloc( p_sys->p_header, p_sys->i_header_allocated ); 
     
    301249            memcpy( &p_sys->p_header[p_sys->i_header_size], 
    302250                    p_buffer->p_buffer, 
    303                     p_buffer->i_size ); 
    304             p_sys->i_header_size += p_buffer->i_size
     251                    p_buffer->i_buffer ); 
     252            p_sys->i_header_size += p_buffer->i_buffer
    305253        } 
    306254        else if( !p_sys->b_header_complete ) 
     
    314262        /* send data */ 
    315263        i_err = httpd_StreamSend( p_sys->p_httpd_stream, p_buffer->p_buffer, 
    316                                   p_buffer->i_size ); 
     264                                  p_buffer->i_buffer ); 
    317265 
    318266        p_next = p_buffer->p_next; 
    319         sout_BufferDelete( p_access->p_sout, p_buffer ); 
     267        block_Release( p_buffer ); 
    320268        p_buffer = p_next; 
    321269 
     
    328276    if( i_err < 0 ) 
    329277    { 
    330         sout_buffer_t *p_next; 
    331         while( p_buffer ) 
    332         { 
    333             p_next = p_buffer->p_next; 
    334             sout_BufferDelete( p_access->p_sout, p_buffer ); 
    335             p_buffer = p_next; 
    336         } 
     278        block_ChainRelease( p_buffer ); 
    337279    } 
    338280 
  • modules/access_output/udp.c

    r53ccc56 r298f0e4  
    3434 
    3535#include <vlc/vlc.h> 
    36 #include <vlc/input.h> 
    3736#include <vlc/sout.h> 
    3837 
     
    5352#include "network.h" 
    5453 
    55 #define DEFAULT_PORT 1234 
    56 /***************************************************************************** 
    57  * Exported prototypes 
    58  *****************************************************************************/ 
    59 static int     Open   ( vlc_object_t * ); 
    60 static void    Close  ( vlc_object_t * ); 
    61  
    62 static int     Write   ( sout_access_out_t *, sout_buffer_t * ); 
    63 static int     WriteRaw( sout_access_out_t *, sout_buffer_t * ); 
    64 static int     Seek    ( sout_access_out_t *, off_t  ); 
    65  
    66 static void    ThreadWrite( vlc_object_t * ); 
    67  
    68 static sout_buffer_t *NewUDPPacket( sout_access_out_t *, mtime_t ); 
    6954 
    7055/***************************************************************************** 
    7156 * Module descriptor 
    7257 *****************************************************************************/ 
     58static int  Open ( vlc_object_t * ); 
     59static void Close( vlc_object_t * ); 
     60 
    7361#define CACHING_TEXT N_("Caching value (ms)") 
    7462#define CACHING_LONGTEXT N_( \ 
     
    8674vlc_module_end(); 
    8775 
     76/***************************************************************************** 
     77 * Exported prototypes 
     78 *****************************************************************************/ 
     79static int  Write   ( sout_access_out_t *, block_t * ); 
     80static int  WriteRaw( sout_access_out_t *, block_t * ); 
     81static int  Seek    ( sout_access_out_t *, off_t  ); 
     82 
     83static void ThreadWrite( vlc_object_t * ); 
     84 
     85static block_t *NewUDPPacket( sout_access_out_t *, mtime_t ); 
     86 
     87 
    8888typedef struct sout_access_thread_t 
    8989{ 
     
    9292    sout_instance_t *p_sout; 
    9393 
    94     sout_fifo_t *p_fifo; 
     94    block_fifo_t *p_fifo; 
    9595 
    9696    int         i_handle; 
     
    110110    unsigned int        i_mtu; 
    111111 
    112     sout_buffer_t       *p_buffer; 
     112    block_t             *p_buffer; 
    113113 
    114114    sout_access_thread_t *p_thread; 
    115115 
    116116}; 
     117 
     118#define DEFAULT_PORT 1234 
    117119 
    118120/***************************************************************************** 
     
    192194    p_sys->p_thread->b_die  = 0; 
    193195    p_sys->p_thread->b_error= 0; 
    194     p_sys->p_thread->p_fifo = sout_FifoCreate( p_access->p_sout ); 
     196    p_sys->p_thread->p_fifo = block_FifoNew( p_access ); 
    195197 
    196198    socket_desc.i_type = NETWORK_UDP; 
     
    267269    p_access->pf_seek = Seek; 
    268270 
    269     msg_Info( p_access, "Open: addr:`%s' port:`%d'", psz_dst_addr, i_dst_port); 
     271    msg_Dbg( p_access, "udp access output opened(%s:%d)", psz_dst_addr, i_dst_port ); 
    270272 
    271273    free( psz_dst_addr ); 
     
    289291    for( i = 0; i < 10; i++ ) 
    290292    { 
    291         sout_buffer_t *p_dummy; 
    292  
    293         p_dummy = sout_BufferNew( p_access->p_sout, p_sys->i_mtu ); 
     293        block_t *p_dummy = block_New( p_access, p_sys->i_mtu ); 
    294294        p_dummy->i_dts = 0; 
    295295        p_dummy->i_pts = 0; 
    296296        p_dummy->i_length = 0; 
    297         sout_FifoPut( p_sys->p_thread->p_fifo, p_dummy ); 
     297        block_FifoPut( p_sys->p_thread->p_fifo, p_dummy ); 
    298298    } 
    299299    vlc_thread_join( p_sys->p_thread ); 
    300300 
    301     sout_FifoDestroy( p_access->p_sout, p_sys->p_thread->p_fifo ); 
     301    block_FifoRelease( p_sys->p_thread->p_fifo ); 
    302302 
    303303    if( p_sys->p_buffer ) 
    304304    { 
    305         sout_BufferDelete( p_access->p_sout, p_sys->p_buffer ); 
     305        block_Release( p_sys->p_buffer ); 
    306306    } 
    307307 
     
    311311    p_access->p_sout->i_out_pace_nocontrol--; 
    312312 
     313    msg_Dbg( p_access, "udp access output closed" ); 
    313314    free( p_sys ); 
    314     msg_Info( p_access, "Close" ); 
    315315} 
    316316 
     
    318318 * Write: standard write on a file descriptor. 
    319319 *****************************************************************************/ 
    320 static int Write( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) 
     320static int Write( sout_access_out_t *p_access, block_t *p_buffer ) 
    321321{ 
    322322    sout_access_out_sys_t *p_sys = p_access->p_sys; 
     
    325325    while( p_buffer ) 
    326326    { 
    327         sout_buffer_t *p_next; 
    328         if( p_buffer->i_size > p_sys->i_mtu ) 
     327        block_t *p_next; 
     328        if( p_buffer->i_buffer > p_sys->i_mtu ) 
    329329        { 
    330330            msg_Warn( p_access, "arggggggggggggg packet size > mtu" ); 
     
    333333        else 
    334334        { 
    335             i_write = p_buffer->i_size
     335            i_write = p_buffer->i_buffer
    336336        } 
    337337 
    338338        /* if we have enough data, enque the buffer */ 
    339339        if( p_sys->p_buffer && 
    340             p_sys->p_buffer->i_size + i_write > p_sys->i_mtu ) 
    341         { 
    342             sout_FifoPut( p_sys->p_thread->p_fifo, p_sys->p_buffer ); 
     340            p_sys->p_buffer->i_buffer + i_write > p_sys->i_mtu ) 
     341        { 
     342            block_FifoPut( p_sys->p_thread->p_fifo, p_sys->p_buffer ); 
    343343            p_sys->p_buffer = NULL; 
    344344        } 
     
    349349        } 
    350350 
    351         if( p_buffer->i_size > 0 ) 
    352         { 
    353             memcpy( p_sys->p_buffer->p_buffer + p_sys->p_buffer->i_size
     351        if( p_buffer->i_buffer > 0 ) 
     352        { 
     353            memcpy( p_sys->p_buffer->p_buffer + p_sys->p_buffer->i_buffer
    354354                    p_buffer->p_buffer, i_write ); 
    355             p_sys->p_buffer->i_size += i_write; 
     355            p_sys->p_buffer->i_buffer += i_write; 
    356356        } 
    357357        p_next = p_buffer->p_next; 
    358         sout_BufferDelete( p_access->p_sout, p_buffer ); 
     358        block_Release( p_buffer ); 
    359359        p_buffer = p_next; 
    360360    } 
     
    366366 * WriteRaw: write p_buffer without trying to fill mtu 
    367367 *****************************************************************************/ 
    368 static int WriteRaw( sout_access_out_t *p_access, sout_buffer_t *p_buffer ) 
     368static int WriteRaw( sout_access_out_t *p_access, block_t *p_buffer ) 
    369369{ 
    370370    sout_access_out_sys_t   *p_sys = p_access->p_sys; 
    371371 
    372     sout_FifoPut( p_sys->p_thread->p_fifo, p_buffer ); 
     372    block_FifoPut( p_sys->p_thread->p_fifo, p_buffer ); 
    373373 
    374374    return( p_sys->p_thread->b_error ? -1 : 0 ); 
     
    381381{ 
    382382    msg_Err( p_access, "UDP sout access cannot seek" ); 
    383     return( -1 )
     383    return -1
    384384} 
    385385 
     
    387387 * NewUDPPacket: allocate a new UDP packet of size p_sys->i_mtu 
    388388 *****************************************************************************/ 
    389 static sout_buffer_t *NewUDPPacket( sout_access_out_t *p_access, mtime_t i_dts) 
     389static block_t *NewUDPPacket( sout_access_out_t *p_access, mtime_t i_dts) 
    390390{ 
    391391    sout_access_out_sys_t *p_sys = p_access->p_sys; 
    392     sout_buffer_t *p_buffer; 
    393  
    394     p_buffer = sout_BufferNew( p_access->p_sout, p_sys->i_mtu ); 
     392    block_t *p_buffer; 
     393 
     394    p_buffer = block_New( p_access->p_sout, p_sys->i_mtu ); 
    395395    p_buffer->i_dts = i_dts; 
    396     p_buffer->i_size = 0; 
     396    p_buffer->i_buffer = 0; 
    397397 
    398398    if( p_sys->b_rtpts ) 
     
    418418        p_buffer->p_buffer[11] = p_sys->i_ssrc&0xff; 
    419419 
    420         p_buffer->i_size = 12; 
     420        p_buffer->i_buffer = 12; 
    421421    } 
    422422 
     
    430430{ 
    431431    sout_access_thread_t *p_thread = (sout_access_thread_t*)p_this; 
    432     sout_instance_t      *p_sout = p_thread->p_sout; 
    433432    mtime_t              i_date_last = -1; 
    434433    mtime_t              i_to_send = p_thread->i_group; 
     
    437436    while( !p_thread->b_die ) 
    438437    { 
    439         sout_buffer_t *p_pk; 
     438        block_t *p_pk; 
    440439        mtime_t       i_date, i_sent; 
    441440 
    442         p_pk = sout_FifoGet( p_thread->p_fifo ); 
     441        p_pk = block_FifoGet( p_thread->p_fifo ); 
    443442 
    444443        i_date = p_thread->i_caching + p_pk->i_dts; 
     
    450449                    msg_Dbg( p_thread, "mmh, hole > 2s -> drop" ); 
    451450 
    452                 sout_BufferDelete( p_sout, p_pk ); 
     451                block_Release( p_pk ); 
    453452                i_date_last = i_date; 
    454453                i_dropped_packets++; 
     
    460459                    msg_Dbg( p_thread, "mmh, paquets in the past -> drop" ); 
    461460 
    462                 sout_BufferDelete( p_sout, p_pk ); 
     461                block_Release( p_pk ); 
    463462                i_date_last = i_date; 
    464463                i_dropped_packets++; 
     
    475474                         i_sent - i_date ); 
    476475            } 
    477             sout_BufferDelete( p_sout, p_pk ); 
     476            block_Release( p_pk ); 
    478477            i_date_last = i_date; 
    479478            i_dropped_packets++; 
     
    487486            i_to_send = p_thread->i_group; 
    488487        } 
    489         send( p_thread->i_handle, p_pk->p_buffer, p_pk->i_size, 0 ); 
     488        send( p_thread->i_handle, p_pk->p_buffer, p_pk->i_buffer, 0 ); 
    490489 
    491490        if( i_dropped_packets ) 
     
    504503#endif 
    505504 
    506         sout_BufferDelete( p_sout, p_pk ); 
     505        block_Release( p_pk ); 
    507506        i_date_last = i_date; 
    508507    }