mirror of
https://github.com/mpv-player/mpv
synced 2025-01-01 04:36:24 +01:00
Kept the HTTP connection open after autodetect, so
we don't need to reopen and request a second time. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4047 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
1f630b5ebd
commit
61b0de3564
@ -72,6 +72,53 @@ asf_streaming_start( stream_t *stream ) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
asf_streaming(ASF_stream_chunck_t *stream_chunck, int *drop_packet ) {
|
||||||
|
/*
|
||||||
|
printf("ASF stream chunck size=%d\n", stream_chunck->size);
|
||||||
|
printf("length: %d\n", length );
|
||||||
|
printf("0x%02X\n", stream_chunck->type );
|
||||||
|
*/
|
||||||
|
if( drop_packet!=NULL ) *drop_packet = 0;
|
||||||
|
|
||||||
|
if( stream_chunck->size<8 ) {
|
||||||
|
printf("Ahhhh, stream_chunck size is too small: %d\n", stream_chunck->size);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if( stream_chunck->size!=stream_chunck->size_confirm ) {
|
||||||
|
printf("size_confirm mismatch!: %d %d\n", stream_chunck->size, stream_chunck->size_confirm);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
printf(" type: 0x%02X\n", stream_chunck->type );
|
||||||
|
printf(" size: %d (0x%02X)\n", stream_chunck->size, stream_chunck->size );
|
||||||
|
printf(" sequence_number: 0x%04X\n", stream_chunck->sequence_number );
|
||||||
|
printf(" unknown: 0x%02X\n", stream_chunck->unknown );
|
||||||
|
printf(" size_confirm: 0x%02X\n", stream_chunck->size_confirm );
|
||||||
|
*/
|
||||||
|
switch(stream_chunck->type) {
|
||||||
|
case 0x4324: // $C Clear ASF configuration
|
||||||
|
printf("=====> Clearing ASF stream configuration!\n");
|
||||||
|
if( drop_packet!=NULL ) *drop_packet = 1;
|
||||||
|
return stream_chunck->size;
|
||||||
|
break;
|
||||||
|
case 0x4424: // $D Data follows
|
||||||
|
// printf("=====> Data follows\n");
|
||||||
|
break;
|
||||||
|
case 0x4524: // $E Transfer complete
|
||||||
|
printf("=====> Transfer complete\n");
|
||||||
|
if( drop_packet!=NULL ) *drop_packet = 1;
|
||||||
|
return stream_chunck->size;
|
||||||
|
break;
|
||||||
|
case 0x4824: // $H ASF header chunk follows
|
||||||
|
printf("=====> ASF header chunk follows\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
printf("=====> Unknown stream type 0x%x\n", stream_chunck->type );
|
||||||
|
}
|
||||||
|
return stream_chunck->size+4;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) {
|
asf_streaming_parse_header(int fd, streaming_ctrl_t* streaming_ctrl) {
|
||||||
ASF_header_t asfh;
|
ASF_header_t asfh;
|
||||||
@ -283,53 +330,6 @@ asf_http_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *strea
|
|||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
asf_streaming(ASF_stream_chunck_t *stream_chunck, int *drop_packet ) {
|
|
||||||
/*
|
|
||||||
printf("ASF stream chunck size=%d\n", stream_chunck->size);
|
|
||||||
printf("length: %d\n", length );
|
|
||||||
printf("0x%02X\n", stream_chunck->type );
|
|
||||||
*/
|
|
||||||
if( drop_packet!=NULL ) *drop_packet = 0;
|
|
||||||
|
|
||||||
if( stream_chunck->size<8 ) {
|
|
||||||
printf("Ahhhh, stream_chunck size is too small: %d\n", stream_chunck->size);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if( stream_chunck->size!=stream_chunck->size_confirm ) {
|
|
||||||
printf("size_confirm mismatch!: %d %d\n", stream_chunck->size, stream_chunck->size_confirm);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
printf(" type: 0x%02X\n", stream_chunck->type );
|
|
||||||
printf(" size: %d (0x%02X)\n", stream_chunck->size, stream_chunck->size );
|
|
||||||
printf(" sequence_number: 0x%04X\n", stream_chunck->sequence_number );
|
|
||||||
printf(" unknown: 0x%02X\n", stream_chunck->unknown );
|
|
||||||
printf(" size_confirm: 0x%02X\n", stream_chunck->size_confirm );
|
|
||||||
*/
|
|
||||||
switch(stream_chunck->type) {
|
|
||||||
case 0x4324: // $C Clear ASF configuration
|
|
||||||
printf("=====> Clearing ASF stream configuration!\n");
|
|
||||||
if( drop_packet!=NULL ) *drop_packet = 1;
|
|
||||||
return stream_chunck->size;
|
|
||||||
break;
|
|
||||||
case 0x4424: // $D Data follows
|
|
||||||
// printf("=====> Data follows\n");
|
|
||||||
break;
|
|
||||||
case 0x4524: // $E Transfer complete
|
|
||||||
printf("=====> Transfer complete\n");
|
|
||||||
if( drop_packet!=NULL ) *drop_packet = 1;
|
|
||||||
return stream_chunck->size;
|
|
||||||
break;
|
|
||||||
case 0x4824: // $H ASF header chunk follows
|
|
||||||
printf("=====> ASF header chunk follows\n");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
printf("=====> Unknown stream type 0x%x\n", stream_chunck->type );
|
|
||||||
}
|
|
||||||
return stream_chunck->size+4;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
asf_http_streaming_seek( int fd, off_t pos, streaming_ctrl_t *streaming_ctrl ) {
|
asf_http_streaming_seek( int fd, off_t pos, streaming_ctrl_t *streaming_ctrl ) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -377,7 +377,6 @@ asf_http_request(streaming_ctrl_t *streaming_ctrl) {
|
|||||||
asf_http_streaming_ctrl_t *asf_http_ctrl = (asf_http_streaming_ctrl_t*)streaming_ctrl->data;
|
asf_http_streaming_ctrl_t *asf_http_ctrl = (asf_http_streaming_ctrl_t*)streaming_ctrl->data;
|
||||||
char str[250];
|
char str[250];
|
||||||
char *ptr;
|
char *ptr;
|
||||||
char *request;
|
|
||||||
int i,as = -1,vs = -1;
|
int i,as = -1,vs = -1;
|
||||||
|
|
||||||
int offset_hi=0, offset_lo=0, length=0;
|
int offset_hi=0, offset_lo=0, length=0;
|
||||||
@ -528,7 +527,6 @@ asf_http_streaming_start( stream_t *stream ) {
|
|||||||
asf_http_streaming_ctrl_t *asf_http_ctrl;
|
asf_http_streaming_ctrl_t *asf_http_ctrl;
|
||||||
ASF_StreamType_e streaming_type;
|
ASF_StreamType_e streaming_type;
|
||||||
char buffer[BUFFER_SIZE];
|
char buffer[BUFFER_SIZE];
|
||||||
unsigned int port;
|
|
||||||
int i, ret;
|
int i, ret;
|
||||||
int fd = stream->fd;
|
int fd = stream->fd;
|
||||||
int done;
|
int done;
|
||||||
|
@ -84,10 +84,6 @@ streaming_ctrl_free( streaming_ctrl_t *streaming_ctrl ) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
read_rtp_from_server(int fd, char *buffer, int length) {
|
read_rtp_from_server(int fd, char *buffer, int length) {
|
||||||
int ret;
|
|
||||||
int done=0;
|
|
||||||
fd_set set;
|
|
||||||
struct timeval tv;
|
|
||||||
struct rtpheader rh;
|
struct rtpheader rh;
|
||||||
char *data;
|
char *data;
|
||||||
int len;
|
int len;
|
||||||
@ -233,7 +229,7 @@ http_read_response( int fd ) {
|
|||||||
// By using the protocol, the extension of the file or the content-type
|
// By using the protocol, the extension of the file or the content-type
|
||||||
// we might be able to guess the streaming type.
|
// we might be able to guess the streaming type.
|
||||||
int
|
int
|
||||||
autodetectProtocol(URL_t *url, int *fd_out) {
|
autodetectProtocol(streaming_ctrl_t *streaming_ctrl, int *fd_out, int *file_format) {
|
||||||
HTTP_header_t *http_hdr;
|
HTTP_header_t *http_hdr;
|
||||||
int fd=-1;
|
int fd=-1;
|
||||||
int i;
|
int i;
|
||||||
@ -243,14 +239,19 @@ autodetectProtocol(URL_t *url, int *fd_out) {
|
|||||||
char *next_url;
|
char *next_url;
|
||||||
char response[1024];
|
char response[1024];
|
||||||
|
|
||||||
|
URL_t *url = streaming_ctrl->url;
|
||||||
|
*file_format = DEMUXER_TYPE_UNKNOWN;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
*fd_out=-1;
|
*fd_out = -1;
|
||||||
next_url = NULL;
|
next_url = NULL;
|
||||||
extension = NULL;
|
extension = NULL;
|
||||||
content_type = NULL;
|
content_type = NULL;
|
||||||
redirect = 0;
|
redirect = 0;
|
||||||
|
|
||||||
if( url==NULL ) return DEMUXER_TYPE_UNKNOWN;
|
if( url==NULL ) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the extension of the file if present
|
// Get the extension of the file if present
|
||||||
if( url->file!=NULL ) {
|
if( url->file!=NULL ) {
|
||||||
@ -267,8 +268,8 @@ extension=NULL;
|
|||||||
// Look for the extension in the extensions table
|
// Look for the extension in the extensions table
|
||||||
for( i=0 ; i<(sizeof(extensions_table)/sizeof(extensions_table[0])) ; i++ ) {
|
for( i=0 ; i<(sizeof(extensions_table)/sizeof(extensions_table[0])) ; i++ ) {
|
||||||
if( !strcasecmp(extension, extensions_table[i].extension) ) {
|
if( !strcasecmp(extension, extensions_table[i].extension) ) {
|
||||||
//if( url->port==0 ) url->port = 80;
|
*file_format = extensions_table[i].demuxer_type;
|
||||||
return extensions_table[i].demuxer_type;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,24 +277,22 @@ extension=NULL;
|
|||||||
// Checking for RTSP
|
// Checking for RTSP
|
||||||
if( !strcasecmp(url->protocol, "rtsp") ) {
|
if( !strcasecmp(url->protocol, "rtsp") ) {
|
||||||
printf("RTSP protocol not yet implemented!\n");
|
printf("RTSP protocol not yet implemented!\n");
|
||||||
return DEMUXER_TYPE_UNKNOWN;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checking for RTP
|
// Checking for RTP
|
||||||
if( !strcasecmp(url->protocol, "rtp") ) {
|
if( !strcasecmp(url->protocol, "rtp") ) {
|
||||||
if( url->port==0 )
|
if( url->port==0 ) {
|
||||||
{
|
|
||||||
printf("You must enter a port number for RTP streams!\n");
|
printf("You must enter a port number for RTP streams!\n");
|
||||||
exit(1); //fixme
|
return -1;
|
||||||
}
|
}
|
||||||
*fd_out=-1;
|
return -1;
|
||||||
return DEMUXER_TYPE_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checking for ASF
|
// Checking for ASF
|
||||||
if( !strncasecmp(url->protocol, "mms", 3) ) {
|
if( !strncasecmp(url->protocol, "mms", 3) ) {
|
||||||
//if( url->port==0 ) url->port = 80;
|
*file_format = DEMUXER_TYPE_ASF;
|
||||||
return DEMUXER_TYPE_ASF;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTP based protocol
|
// HTTP based protocol
|
||||||
@ -302,26 +301,26 @@ extension=NULL;
|
|||||||
|
|
||||||
fd = http_send_request( url );
|
fd = http_send_request( url );
|
||||||
if( fd<0 ) {
|
if( fd<0 ) {
|
||||||
*fd_out=-1;
|
return -1;
|
||||||
return DEMUXER_TYPE_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
http_hdr = http_read_response( fd );
|
http_hdr = http_read_response( fd );
|
||||||
if( http_hdr==NULL ) {
|
if( http_hdr==NULL ) {
|
||||||
close( fd );
|
close( fd );
|
||||||
*fd_out=-1;
|
|
||||||
http_free( http_hdr );
|
http_free( http_hdr );
|
||||||
return DEMUXER_TYPE_UNKNOWN;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*fd_out=fd;
|
*fd_out=fd;
|
||||||
http_debug_hdr( http_hdr );
|
http_debug_hdr( http_hdr );
|
||||||
|
|
||||||
|
streaming_ctrl->data = (void*)http_hdr;
|
||||||
|
|
||||||
// Check if the response is an ICY status_code reason_phrase
|
// Check if the response is an ICY status_code reason_phrase
|
||||||
if( !strcasecmp(http_hdr->protocol, "ICY") ) {
|
if( !strcasecmp(http_hdr->protocol, "ICY") ) {
|
||||||
// Ok, we have detected an mp3 streaming
|
// Ok, we have detected an mp3 streaming
|
||||||
http_free( http_hdr );
|
*file_format = DEMUXER_TYPE_MPEG_PS;
|
||||||
return DEMUXER_TYPE_MPEG_PS;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( http_hdr->status_code ) {
|
switch( http_hdr->status_code ) {
|
||||||
@ -334,10 +333,13 @@ extension=NULL;
|
|||||||
// Check in the mime type table for a demuxer type
|
// Check in the mime type table for a demuxer type
|
||||||
for( i=0 ; i<(sizeof(mime_type_table)/sizeof(mime_type_table[0])) ; i++ ) {
|
for( i=0 ; i<(sizeof(mime_type_table)/sizeof(mime_type_table[0])) ; i++ ) {
|
||||||
if( !strcasecmp( content_type, mime_type_table[i].mime_type ) ) {
|
if( !strcasecmp( content_type, mime_type_table[i].mime_type ) ) {
|
||||||
http_free( http_hdr );
|
*file_format = mime_type_table[i].demuxer_type;
|
||||||
return mime_type_table[i].demuxer_type;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Not found in the mime type table, don't fail,
|
||||||
|
// we should try raw HTTP
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
// Redirect
|
// Redirect
|
||||||
@ -349,24 +351,21 @@ extension=NULL;
|
|||||||
close( fd );
|
close( fd );
|
||||||
url_free( url );
|
url_free( url );
|
||||||
url = url_new( next_url );
|
url = url_new( next_url );
|
||||||
|
http_free( http_hdr );
|
||||||
redirect = 1;
|
redirect = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("Server returned %d: %s\n", http_hdr->status_code, http_hdr->reason_phrase );
|
printf("Server returned %d: %s\n", http_hdr->status_code, http_hdr->reason_phrase );
|
||||||
close( fd );
|
return -1;
|
||||||
*fd_out=-1;
|
|
||||||
http_free( http_hdr );
|
|
||||||
return DEMUXER_TYPE_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Unknown protocol '%s'\n", url->protocol );
|
printf("Unknown protocol '%s'\n", url->protocol );
|
||||||
return DEMUXER_TYPE_UNKNOWN;
|
return -1;
|
||||||
}
|
}
|
||||||
} while( redirect );
|
} while( redirect );
|
||||||
|
|
||||||
http_free( http_hdr );
|
return -1;
|
||||||
return DEMUXER_TYPE_UNKNOWN;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -423,7 +422,7 @@ nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ) {
|
|||||||
|
|
||||||
int
|
int
|
||||||
nop_streaming_start( stream_t *stream ) {
|
nop_streaming_start( stream_t *stream ) {
|
||||||
HTTP_header_t *http_hdr;
|
HTTP_header_t *http_hdr = NULL;
|
||||||
int fd;
|
int fd;
|
||||||
if( stream==NULL ) return -1;
|
if( stream==NULL ) return -1;
|
||||||
|
|
||||||
@ -451,7 +450,19 @@ nop_streaming_start( stream_t *stream ) {
|
|||||||
fd = -1;
|
fd = -1;
|
||||||
}
|
}
|
||||||
stream->fd = fd;
|
stream->fd = fd;
|
||||||
|
} else {
|
||||||
|
http_hdr = (HTTP_header_t*)stream->streaming_ctrl->data;
|
||||||
|
if( http_hdr->body_size>0 ) {
|
||||||
|
if( streaming_bufferize( stream->streaming_ctrl, http_hdr->body, http_hdr->body_size )<0 ) {
|
||||||
|
http_free( http_hdr );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( http_hdr ) {
|
||||||
http_free( http_hdr );
|
http_free( http_hdr );
|
||||||
|
stream->streaming_ctrl->data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream->streaming_ctrl->streaming_read = nop_streaming_read;
|
stream->streaming_ctrl->streaming_read = nop_streaming_read;
|
||||||
@ -467,11 +478,9 @@ nop_streaming_start( stream_t *stream ) {
|
|||||||
// Start listening on a UDP port. If multicast, join the group.
|
// Start listening on a UDP port. If multicast, join the group.
|
||||||
int
|
int
|
||||||
rtp_open_socket( URL_t *url ) {
|
rtp_open_socket( URL_t *url ) {
|
||||||
int fd;
|
|
||||||
int socket_server_fd;
|
int socket_server_fd;
|
||||||
int err, err_len;
|
int err, err_len;
|
||||||
fd_set set;
|
fd_set set;
|
||||||
struct timeval tv;
|
|
||||||
struct sockaddr_in server_address;
|
struct sockaddr_in server_address;
|
||||||
struct ip_mreq mcast;
|
struct ip_mreq mcast;
|
||||||
|
|
||||||
@ -559,31 +568,21 @@ rtp_streaming_start( stream_t *stream ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
streaming_start(stream_t *stream, URL_t *url, int demuxer_type) {
|
//streaming_start(stream_t *stream, URL_t *url, int demuxer_type) {
|
||||||
|
streaming_start(stream_t *stream, int demuxer_type) {
|
||||||
int ret=-1;
|
int ret=-1;
|
||||||
if( stream==NULL ) return -1;
|
if( stream==NULL ) return -1;
|
||||||
|
|
||||||
stream->streaming_ctrl = streaming_ctrl_new( );
|
|
||||||
if( stream->streaming_ctrl==NULL ) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stream->streaming_ctrl->url = url_copy(url);
|
|
||||||
// stream->streaming_ctrl->demuxer_type = demuxer_type;
|
|
||||||
|
|
||||||
// For RTP streams, we usually don't know the stream type until we open it.
|
// For RTP streams, we usually don't know the stream type until we open it.
|
||||||
if( !strcmp( url->protocol, "rtp"))
|
if( !strcmp( stream->streaming_ctrl->url->protocol, "rtp")) {
|
||||||
{
|
if(stream->fd >= 0) {
|
||||||
if(stream->fd >= 0)
|
|
||||||
{
|
|
||||||
if(close(stream->fd) < 0)
|
if(close(stream->fd) < 0)
|
||||||
printf("streaming_start : Closing socket %d failed %s\n",stream->fd,strerror(errno));
|
printf("streaming_start : Closing socket %d failed %s\n",stream->fd,strerror(errno));
|
||||||
}
|
}
|
||||||
stream->fd = -1;
|
stream->fd = -1;
|
||||||
stream->fd = rtp_streaming_start( stream );
|
stream->fd = rtp_streaming_start( stream );
|
||||||
}
|
} else
|
||||||
// For connection-oriented streams, we can usually determine the streaming type.
|
// For connection-oriented streams, we can usually determine the streaming type.
|
||||||
else
|
|
||||||
switch( demuxer_type ) {
|
switch( demuxer_type ) {
|
||||||
case DEMUXER_TYPE_ASF:
|
case DEMUXER_TYPE_ASF:
|
||||||
// Send the appropriate HTTP request
|
// Send the appropriate HTTP request
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
|
#include "stream.h"
|
||||||
|
|
||||||
#define BUFFER_SIZE 2048
|
#define BUFFER_SIZE 2048
|
||||||
|
|
||||||
@ -37,6 +38,13 @@ typedef struct streaming_control {
|
|||||||
void *data;
|
void *data;
|
||||||
} streaming_ctrl_t;
|
} streaming_ctrl_t;
|
||||||
|
|
||||||
|
streaming_ctrl_t *streaming_ctrl_new();
|
||||||
|
void streaming_ctrl_free( streaming_ctrl_t *streaming_ctrl );
|
||||||
|
|
||||||
|
int autodetectProtocol( streaming_ctrl_t *streaming_ctrl, int *fd_out, int *file_format );
|
||||||
|
|
||||||
|
//int streaming_start( stream_t *stream, int demuxer_type );
|
||||||
|
|
||||||
int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size);
|
int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size);
|
||||||
|
|
||||||
int nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl );
|
int nop_streaming_read( int fd, char *buffer, int size, streaming_ctrl_t *stream_ctrl );
|
||||||
|
@ -372,10 +372,19 @@ tv_err:
|
|||||||
#ifdef STREAMING
|
#ifdef STREAMING
|
||||||
url = url_new(filename);
|
url = url_new(filename);
|
||||||
if(url) {
|
if(url) {
|
||||||
(*file_format)=autodetectProtocol( url, &f );
|
streaming_ctrl_t *streaming_ctrl;
|
||||||
|
streaming_ctrl = streaming_ctrl_new();
|
||||||
|
if( streaming_ctrl==NULL ) return NULL;
|
||||||
|
streaming_ctrl->url = url_copy( url );
|
||||||
|
if( autodetectProtocol( streaming_ctrl, &f, file_format )<0 ) {
|
||||||
|
mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_UnableOpenURL, filename );
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ConnToServer, url->hostname );
|
mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ConnToServer, url->hostname );
|
||||||
stream=new_stream(f,STREAMTYPE_STREAM);
|
stream=new_stream(f,STREAMTYPE_STREAM);
|
||||||
if( streaming_start( stream , url, *file_format )<0){
|
stream->streaming_ctrl = streaming_ctrl;
|
||||||
|
//if( streaming_start( stream , url, *file_format )<0){
|
||||||
|
if( streaming_start( stream, *file_format )<0){
|
||||||
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, filename);
|
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_UnableOpenURL, filename);
|
||||||
url_free(url);
|
url_free(url);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user