[svn-commits] phsultan: branch phsultan/rtmp-support r206805 - in /team/phsultan/rtmp-suppo...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 16 09:42:32 CDT 2009


Author: phsultan
Date: Thu Jul 16 09:42:28 2009
New Revision: 206805

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=206805
Log:
Don't append an index to the stream name to read if we have only two read/write streams

Modified:
    team/phsultan/rtmp-support/channels/chan_rtmp.c
    team/phsultan/rtmp-support/configure

Modified: team/phsultan/rtmp-support/channels/chan_rtmp.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/phsultan/rtmp-support/channels/chan_rtmp.c?view=diff&rev=206805&r1=206804&r2=206805
==============================================================================
--- team/phsultan/rtmp-support/channels/chan_rtmp.c (original)
+++ team/phsultan/rtmp-support/channels/chan_rtmp.c Thu Jul 16 09:42:28 2009
@@ -678,11 +678,21 @@
 	parse = ast_strdupa(data);
         AST_NONSTANDARD_APP_ARGS(args, parse, '/');
 
+	if (ast_strlen_zero(args.readstream)) {
+		ast_log(LOG_WARNING, "The RTMP driver requires a stream identifier to read\n");
+		return NULL;
+	}
+
+	if (ast_strlen_zero(args.writestream)) {
+		ast_log(LOG_WARNING, "The RTMP driver requires a stream identifier to publish\n");
+		return NULL;
+	}
+
 	ast_debug(3, "Building new stream, parse : %s\n", parse);
 	ast_debug(3, "writestream : %s\n", args.writestream);
 	ast_debug(3, "readstream : %s\n", args.readstream);
-	ast_debug(3, "readnum : %s\n", args.readnum);
-	p = rtmp_alloc(args.writestream, args.readstream, args.readnum);
+	ast_debug(3, "readnum : %s\n", ast_strlen_zero(args.readnum) ? "None" : args.readnum);
+	p = rtmp_alloc(args.writestream, args.readstream, ast_strlen_zero(args.readnum) ? NULL : args.readnum);
 
 	if (p) {
 		tmp = rtmp_new(p, AST_STATE_DOWN, requestor ? requestor->linkedid : NULL);
@@ -2492,7 +2502,10 @@
 				ast_copy_string(readstream_name, p->readstream, AST_MAX_EXTENSION);	
 				snprintf(readstream_index, sizeof(readstream_index), "-%d", p->readstream_index);
 				ast_log(LOG_NOTICE, "readstream_index : %s\n", readstream_index);
-				strcat(readstream_name, readstream_index);
+				if (p->numstreams > 2) {
+					// don't append the index if we have only two streams (read/write)
+					strcat(readstream_name, readstream_index);
+				}
 				ast_log(LOG_NOTICE, "readstream_name : %s\n", readstream_name);
 				p->readstream_index++;
 				res = rtmp_send_play(client, result, readstream_name);




More information about the svn-commits mailing list