[MPlayer-cvslog] r19098 - trunk/libmpdemux/realrtsp/sdpplin.c
rtogni
subversion at mplayerhq.hu
Sat Jul 15 01:06:59 CEST 2006
Author: rtogni
Date: Sat Jul 15 01:06:58 2006
New Revision: 19098
Modified:
trunk/libmpdemux/realrtsp/sdpplin.c
Log:
Assume that missing streamcount means one stream, and missing mimetype
is audio. This seems to be used for some audio-only streams.
Fixes rtsp://ms.espectador.com/audio/app_metafiles/dol0606282.rm
Modified: trunk/libmpdemux/realrtsp/sdpplin.c
==============================================================================
--- trunk/libmpdemux/realrtsp/sdpplin.c (original)
+++ trunk/libmpdemux/realrtsp/sdpplin.c Sat Jul 15 01:06:58 2006
@@ -131,6 +131,7 @@
char *buf=xbuffer_init(32);
char *decoded=xbuffer_init(32);
int handled;
+ int got_mimetype;
if (filter(*data, "m=", &buf)) {
desc->id = strdup(buf);
@@ -143,7 +144,17 @@
}
*data=nl(*data);
+ got_mimetype = 0;
+
while (*data && **data && *data[0]!='m') {
+#ifdef LOG
+ {
+ int len=strchr(*data,'\n')-(*data);
+ buf = xbuffer_copyin(buf, 0, *data, len+1);
+ buf[len]=0;
+ printf("libreal: sdpplin_stream: '%s'\n", buf);
+ }
+#endif
handled=0;
@@ -198,6 +209,7 @@
desc->mime_type=strdup(buf);
desc->mime_type_size=strlen(desc->mime_type);
handled=1;
+ got_mimetype = 1;
*data=nl(*data);
}
@@ -223,12 +235,20 @@
int len=strchr(*data,'\n')-(*data);
buf = xbuffer_copyin(buf, 0, *data, len+1);
buf[len]=0;
- printf("libreal: sdpplin: not handled: '%s'\n", buf);
+ printf("libreal: sdpplin_stream: not handled: '%s'\n", buf);
#endif
*data=nl(*data);
}
}
+ if (!got_mimetype) {
+ mp_msg(MSGT_OPEN, MSGL_V, "libreal: sdpplin_stream: no mimetype\n");
+ desc->mime_type = strdup("audio/x-pn-realaudio");
+ desc->mime_type_size = strlen(desc->mime_type);
+ if (desc->stream_id)
+ mp_msg(MSGT_OPEN, MSGL_WARN, "libreal: sdpplin_stream: implicit mimetype for stream_id != 0, weird.\n");
+ }
+
xbuffer_free(buf);
xbuffer_free(decoded);
@@ -244,6 +264,14 @@
int len;
while (data && *data) {
+#ifdef LOG
+ {
+ int len=strchr(data,'\n')-(data);
+ buf = xbuffer_copyin(buf, 0, data, len+1);
+ buf[len]=0;
+ printf("libreal: sdpplin: '%s'\n", buf);
+ }
+#endif
handled=0;
@@ -254,10 +282,21 @@
#endif
if (desc->stream && (stream->stream_id >= 0) && (stream->stream_id < desc->stream_count))
desc->stream[stream->stream_id]=stream;
- else
+ else if (desc->stream)
{
- mp_msg(MSGT_OPEN, MSGL_ERR, "sdpplin: got 'm=', but 'a=StreamCount' is still unknown. Broken sdp?\n");
+ mp_msg(MSGT_OPEN, MSGL_ERR, "sdpplin: bad stream_id %d (must be >= 0, < %d). Broken sdp?\n",
+ stream->stream_id, desc->stream_count);
free(stream);
+ } else {
+ mp_msg(MSGT_OPEN, MSGL_V, "sdpplin: got 'm=', but 'a=StreamCount' is still unknown.\n");
+ if (stream->stream_id == 0) {
+ desc->stream_count=1;
+ desc->stream=malloc(sizeof(sdpplin_stream_t*));
+ desc->stream[0]=stream;
+ } else {
+ mp_msg(MSGT_OPEN, MSGL_ERR, "sdpplin: got 'm=', but 'a=StreamCount' is still unknown and stream_id != 0. Broken sdp?\n");
+ free(stream);
+ }
}
continue;
}
More information about the MPlayer-cvslog
mailing list