lib/rtsp/client.rb in rtsp-0.1.2 vs lib/rtsp/client.rb in rtsp-0.2.0
- old
+ new
@@ -103,11 +103,14 @@
# @yieldparam [Struct::Connection] interleave=
# @todo Use server_url everywhere; just use URI to ensure the port & rtspu.
def initialize(server_url=nil)
Thread.abort_on_exception = true
- Struct.new("Connection", :server_url, :timeout, :socket,
+ unless defined? Struct::Connection
+ Struct.new("Connection", :server_url, :timeout, :socket,
:do_capture, :interleave)
+ end
+
@connection = Struct::Connection.new
@capturer = RTSP::Capturer.new
yield(connection, capturer) if block_given?