rtp_set_ptime (id, 20, 1);
break;
case VLC_CODEC_S16B:
+ case VLC_CODEC_S16L:
if( p_fmt->audio.i_channels == 1 && p_fmt->audio.i_rate == 44100 )
{
id->i_payload_type = 11;
id->i_payload_type = 10;
}
id->psz_enc = "L16";
- id->pf_packetize = rtp_packetize_split;
+ if( p_fmt->i_codec == VLC_CODEC_S16B )
+ id->pf_packetize = rtp_packetize_split;
+ else
+ id->pf_packetize = rtp_packetize_swab;
rtp_set_ptime (id, 20, 2);
break;
case VLC_CODEC_U8:
int rtp_packetize_mpv (sout_stream_id_t *, block_t *);
int rtp_packetize_ac3 (sout_stream_id_t *, block_t *);
int rtp_packetize_split(sout_stream_id_t *, block_t *);
+int rtp_packetize_swab (sout_stream_id_t *, block_t *);
int rtp_packetize_mp4a (sout_stream_id_t *, block_t *);
int rtp_packetize_mp4a_latm (sout_stream_id_t *, block_t *);
int rtp_packetize_h263 (sout_stream_id_t *, block_t *);
return VLC_SUCCESS;
}
+/* split and convert from little endian to network byte order */
+int rtp_packetize_swab( sout_stream_id_t *id, block_t *in )
+{
+ int i_max = rtp_mtu (id); /* payload max in one packet */
+ int i_count = ( in->i_buffer + i_max - 1 ) / i_max;
+
+ uint8_t *p_data = in->p_buffer;
+ int i_data = in->i_buffer;
+ int i;
+
+ for( i = 0; i < i_count; i++ )
+ {
+ int i_payload = __MIN( i_max, i_data );
+ block_t *out = block_Alloc( 12 + i_payload );
+
+ /* rtp common header */
+ rtp_packetize_common( id, out, (i == i_count - 1),
+ (in->i_pts > 0 ? in->i_pts : in->i_dts) );
+ swab( p_data, out->p_buffer + 12, i_payload );
+
+ out->i_buffer = 12 + i_payload;
+ out->i_dts = in->i_dts + i * in->i_length / i_count;
+ out->i_length = in->i_length / i_count;
+
+ rtp_packetize_send( id, out );
+
+ p_data += i_payload;
+ i_data -= i_payload;
+ }
+
+ return VLC_SUCCESS;
+}
+
/* rfc3016 */
int rtp_packetize_mp4a_latm( sout_stream_id_t *id, block_t *in )
{