Author: adrian
Date: Sun Feb 28 07:43:46 2010
New Revision: 8598
URL: http://svn.slimdevices.com/jive?rev=8598&view=rev
Log:
Bug: N/A
Description: handle end of rtmp streams by actively closing them and setting
the streaming state to false. This allows the them to transition to decode
underrun and hence send the correct end of stream status to the server.
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Rtmp.lua
7.5/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c
Modified: 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Rtmp.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Rtmp.lua?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Rtmp.lua (original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Rtmp.lua Sun Feb 28
07:43:46 2010
@@ -396,6 +396,8 @@
local new, error = stream:readToLua()
if error then
+ stream:setStreaming(false)
+ stream:disconnect()
return
end
if new then
@@ -420,6 +422,8 @@
local newstate = handler(stream, packet)
if not newstate then
+ stream:setStreaming(false)
+ stream:disconnect()
return
end
@@ -444,6 +448,8 @@
if (chan == 0 or chan == 1) then
log:error("rtmp chan > 63 - not supported")
+ stream:setStreaming(false)
+ stream:disconnect()
return
end
@@ -590,6 +596,8 @@
if handler then
local ret, error = handler(stream, rtmp)
if error then
+ stream:setStreaming(false)
+ stream:disconnect()
return ret
end
if ret then
Modified: 7.5/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c?rev=8598&r1=8597&r2=8598&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c (original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/src/audio/streambuf.c Sun Feb 28
07:43:46 2010
@@ -782,6 +782,17 @@
}
+static int stream_setstreamingL(lua_State *L) {
+ /*
+ * 1: Stream (self)
+ * 1: Boolean steaming state, used by lua protocol handlers to set
streaming state
+ */
+ streambuf_streaming = lua_toboolean(L, 2);
+
+ return 0;
+}
+
+
static int stream_mark_loopL(lua_State *L) {
fifo_lock(&streambuf_fifo);
@@ -829,6 +840,7 @@
{ "write", stream_writeL },
{ "feedFromLua", stream_feedfromL },
{ "readToLua", stream_readtoL },
+ { "setStreaming", stream_setstreamingL },
{ NULL, NULL }
};
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins