int i;
if( !p_media )
- {
- msg_Err( p_vod, "not enough memory" );
return NULL;
- }
memset( p_media, 0, sizeof(vod_media_t) );
p_media->id = p_sys->i_media_id++;
/* TODO: update SDP, etc... */
if( asprintf( &psz_urlc, "%s/trackID=%d",
p_media->psz_rtsp_path, p_media->i_es ) < 0 )
+ {
+ free( p_es );
return VLC_ENOMEM;
+ }
msg_Dbg( p_vod, " - ES %4.4s (%s)", (char *)&p_fmt->i_codec, psz_urlc );
switch( p_fmt->i_codec )
p_fmt->audio.i_channels );
break;
case VLC_FOURCC( 'm', 'p', 'g', 'a' ):
+ case VLC_FOURCC( 'm', 'p', '3', ' ' ):
p_es->i_payload_type = 14;
p_es->psz_rtpmap = strdup( "MPA/90000" );
break;
break;
case VLC_FOURCC( 'a', '5', '2', ' ' ):
p_es->i_payload_type = p_media->i_payload_type++;
- p_es->psz_rtpmap = strdup( "ac3/90000" );
+ asprintf( &p_es->psz_rtpmap, "ac3/%d", p_fmt->audio.i_rate );
break;
case VLC_FOURCC( 'H', '2', '6', '3' ):
p_es->i_payload_type = p_media->i_payload_type++;
}
/* */
if( p_64_sps && p_64_pps )
+ {
if( asprintf( &p_es->psz_fmtp,
"packetization-mode=1;profile-level-id=%s;"
"sprop-parameter-sets=%s,%s;", hexa, p_64_sps,
p_64_pps ) < 0 )
+ {
+ free( p_64_sps );
+ free( p_64_pps );
+ free( psz_urlc );
+ free( p_es );
return VLC_ENOMEM;
+ }
+ }
free( p_64_sps );
free( p_64_pps );
}
default:
msg_Err( p_vod, "cannot add this stream (unsupported "
"codec: %4.4s)", (char*)&p_fmt->i_codec );
+ free( psz_urlc );
free( p_es );
return VLC_EGENERIC;
}
if( strstr( psz_transport, "MP2T/H2221/UDP" ) )
{
httpd_MsgAdd( answer, "Transport",
- "MP2T/H2221/UDP;client_port=%d-%d",
+ "MP2T/H2221/UDP;unicast;client_port=%d-%d",
i_port, i_port + 1 );
}
else if( strstr( psz_transport, "RAW/RAW/UDP" ) )
{
httpd_MsgAdd( answer, "Transport",
- "RAW/RAW/UDP;client_port=%d-%d",
+ "RAW/RAW/UDP;unicast;client_port=%d-%d",
i_port, i_port + 1 );
}
}
else
httpd_MsgAdd( answer, "Transport",
- "RTP/AVP/UDP;client_port=%d-%d",
+ "RTP/AVP/UDP;unicast;client_port=%d-%d",
i_port, i_port + 1 );
}
else /* TODO strstr( psz_transport, "interleaved" ) ) */