static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
block_t *p_buffer )
{
- block_t *p_next;
-
assert( p_stream->p_sys->p_mux == NULL );
(void)p_stream;
while( p_buffer != NULL )
{
- p_next = p_buffer->p_next;
+ block_t *p_next = p_buffer->p_next;
+ p_buffer->p_next = NULL;
/* Send a Vorbis/Theora Packed Configuration packet (RFC 5215 §3.1)
* as the first packet of the stream */
if( id->rtp_fmt.pf_packetize( id, p_buffer ) )
break;
- block_Release( p_buffer );
p_buffer = p_next;
}
return VLC_SUCCESS;
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
if( i_data < 2 )
{
+ block_Release(in);
return VLC_EGENERIC;
}
if( p_data[0] || p_data[1] )
{
+ block_Release(in);
return VLC_EGENERIC;
}
/* remove 2 leading 0 bytes */
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
i_buffer -= i_skip;
p_buffer += i_skip;
}
+
+ block_Release(in);
return VLC_SUCCESS;
}
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
while( ( p_data[i_payload] & 0xC0 ) == 0x80 )
{
if( i_payload == 0 )
+ {
+ block_Release(in);
return VLC_SUCCESS; /* fishy input! */
-
+ }
i_payload--;
}
}
block_t *out = block_Alloc( 12 + i_payload );
if( out == NULL )
+ {
+ block_Release(in);
return VLC_SUCCESS;
+ }
rtp_packetize_common( id, out, 0, in->i_pts + i_packet );
memcpy( out->p_buffer + 12, p_data, i_payload );
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
block_t *p_out;
if ( in->i_buffer > rtp_mtu (id) )
+ {
+ block_Release(in);
return VLC_SUCCESS;
+ }
/*
RFC for Speex in RTP says that each packet must end on an octet
p_out->i_buffer = 12 + i_payload_size;
p_out->i_dts = in->i_dts;
p_out->i_length = in->i_length;
+ block_Release(in);
/* Queue the buffer for actual transmission. */
rtp_packetize_send( id, p_out );
p_data += i_payload;
i_data -= i_payload;
}
+
+ block_Release(in);
return VLC_SUCCESS;
}
int i_data = in->i_buffer;
if ( i_max <= 0 )
+ {
+ block_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 );
if ( out == NULL )
+ {
+ block_Release(in);
return VLC_ENOMEM;
+ }
/* VP8 payload header */
/* All frames are marked as reference ones */
i_data -= i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
}
// Skip SOI
if (GetWBE(p_data) != 0xffd8)
- return VLC_EGENERIC;
+ goto error;
p_data += 2;
i_data -= 2;
int section_size = GetWBE(section);
uint8_t *section_body = p_data + 4;
if (section + section_size > bufend)
- return VLC_EGENERIC;
+ goto error;
assert((marker & 0xff00) == 0xff00);
switch (marker)
{
case 0xffdb /*DQT*/:
if (section_body[0])
- {
- // Only 8-bit precision is supported
- return VLC_EGENERIC;
- }
+ goto error; // Only 8-bit precision is supported
/* a quantization table is 64 bytes long */
nb_qtables = section_size / 65;
if (width > 2040 || height > 2040)
{
// larger than limit supported by RFC 2435
- return VLC_EGENERIC;
+ goto error;
}
// Round up by 8, divide by 8
w = ((width+7)&~7) >> 3;
// Only 3 components are supported by RFC 2435
if (section_body[5] != 3) // Number of components
- return VLC_EGENERIC;
+ goto error;
for (int j = 0; j < 3; j++)
{
if (section_body[6 + j * 3] == 1 /* Y */)
else if (section_body[6 + j * 3 + 1] != 0x11)
{
// Sampling factor is unsupported by RFC 2435
- return VLC_EGENERIC;
+ goto error;
}
}
break;
i_data -= 2 + section_size;
}
if (!header_finished)
- return VLC_EGENERIC;
+ goto error;
if (!w || !h)
- return VLC_EGENERIC;
+ goto error;
switch (y_sampling_factor)
{
type = 0;
break;
default:
- // Sampling format unsupported by RFC 2435
- return VLC_EGENERIC;
+ goto error; // Sampling format unsupported by RFC 2435
}
if (dri_found)
off += i_payload;
}
+ block_Release(in);
return VLC_SUCCESS;
+error:
+ block_Release(in);
+ return VLC_EGENERIC;
}