diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | remux/extern.c | 2 | ||||
-rw-r--r-- | server/connectionHTTP.c | 16 |
3 files changed, 13 insertions, 6 deletions
@@ -1,6 +1,7 @@ VDR Plugin 'streamdev' Revision History --------------------------------------- +- Support HTTP HEAD requests with external remuxer - Fixed always using priority 0 for HTTP HEAD requests - Start writer right after creating it - Corrected typos (thanks to Ville Skyttä) diff --git a/remux/extern.c b/remux/extern.c index 49be1ce..3ac68bb 100644 --- a/remux/extern.c +++ b/remux/extern.c @@ -295,7 +295,7 @@ void cTSExt::Put(const uchar *Data, int Count) } cExternRemux::cExternRemux(const cServerConnection *Connection, const cChannel *Channel, const int *Apids, const int *Dpids): - m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE, TS_SIZE * 2)), + m_ResultBuffer(new cRingBufferLinear(WRITERBUFSIZE)), m_Remux(new cTSExt(m_ResultBuffer, Connection, Channel, Apids, Dpids)) { m_ResultBuffer->SetTimeouts(500, 100); diff --git a/server/connectionHTTP.c b/server/connectionHTTP.c index d420c25..b9f98b4 100644 --- a/server/connectionHTTP.c +++ b/server/connectionHTTP.c @@ -188,34 +188,40 @@ bool cConnectionHTTP::ProcessRequest(void) && Respond(""); } } else if (it_method->second.compare("HEAD") == 0 && ProcessURI(it_pathinfo->second)) { - DeferClose(); - if (m_ChannelList) + if (m_ChannelList) { + DeferClose(); return Respond("%s", true, m_ChannelList->HttpHeader().c_str()); + } else if (m_Channel != NULL) { if (ProvidesChannel(m_Channel, StreamdevServerSetup.HTTPPriority)) { if (m_StreamType == stEXT) { - // TODO - return Respond("HTTP/1.0 200 OK") - && Respond(""); + m_LiveStreamer = new cStreamdevLiveStreamer(StreamdevServerSetup.HTTPPriority, this); + m_LiveStreamer->SetChannel(m_Channel, m_StreamType, m_Apid[0] ? m_Apid : NULL, m_Dpid[0] ? m_Dpid : NULL); + return Respond("HTTP/1.0 200 OK"); } else if (m_StreamType == stES && (m_Apid[0] || m_Dpid[0] || ISRADIO(m_Channel))) { + DeferClose(); return Respond("HTTP/1.0 200 OK") && Respond("Content-Type: audio/mpeg") && Respond("icy-name: %s", true, m_Channel->Name()) && Respond(""); } else if (ISRADIO(m_Channel)) { + DeferClose(); return Respond("HTTP/1.0 200 OK") && Respond("Content-Type: audio/mpeg") && Respond(""); } else { + DeferClose(); return Respond("HTTP/1.0 200 OK") && Respond("Content-Type: video/mpeg") && Respond(""); } } + DeferClose(); return Respond("HTTP/1.0 503 Service unavailable") && Respond(""); } else { + DeferClose(); return Respond("HTTP/1.0 404 not found") && Respond(""); } |