Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/output/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ outputs = [
{'name' : 'MP3', 'format' : 'mp3', 'extra': ['http']},
{'name' : 'H264', 'format' : 'h264', 'extra': ['http']},
{'name' : 'HDS', 'format' : 'hds', 'extra': ['http']},
{'name' : 'SubRip', 'format' : 'srt', 'extra': ['http']},
{'name' : 'SubRip', 'format' : 'subrip', 'extra': ['http']},
{'name' : 'JSON', 'format' : 'json', 'extra': ['http']},
{'name' : 'TS', 'format' : 'ts', 'extra': ['ts']},
{'name' : 'HTTPTS', 'format' : 'httpts', 'extra': ['http', 'ts']},
Expand Down
14 changes: 7 additions & 7 deletions src/output/output_srt.cpp → src/output/output_subrip.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "output_srt.h"
#include "output_subrip.h"
#include <sstream>
#include <mist/checksum.h>
#include <mist/defines.h>
#include <mist/http_parser.h>

namespace Mist{
OutSRT::OutSRT(Socket::Connection &conn) : HTTPOutput(conn){realTime = 0;}
OutSRT::~OutSRT(){}
OutSubRip::OutSubRip(Socket::Connection &conn) : HTTPOutput(conn){realTime = 0;}
OutSubRip::~OutSubRip(){}

void OutSRT::init(Util::Config *cfg){
void OutSubRip::init(Util::Config *cfg){
HTTPOutput::init(cfg);
capa["name"] = "SubRip";
capa["friendly"] = "SubRip (SRT/WebVTT) over HTTP";
Expand All @@ -29,7 +29,7 @@ namespace Mist{
capa["methods"][1u]["url_rel"] = "/$.webvtt";
}

void OutSRT::sendNext(){
void OutSubRip::sendNext(){
// Reached the end we wanted? Stop here.
if (filter_to > 0 && thisTime > filter_to && filter_to > filter_from){
config->is_active = false;
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace Mist{
myConn.SendNow("\n\n");
}

void OutSRT::sendHeader(){
void OutSubRip::sendHeader(){
H.setCORSHeaders();
H.SetHeader("Content-Type", (webVTT ? "text/vtt; charset=utf-8" : "text/plain; charset=utf-8"));
H.protocol = "HTTP/1.0";
Expand All @@ -72,7 +72,7 @@ namespace Mist{
sentHeader = true;
}

void OutSRT::onHTTP(){
void OutSubRip::onHTTP(){
std::string method = H.method;
webVTT = (H.url.find(".vtt") != std::string::npos) || (H.url.find(".webvtt") != std::string::npos);
if (H.GetVar("track").size()){
Expand Down
8 changes: 4 additions & 4 deletions src/output/output_srt.h → src/output/output_subrip.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "output_http.h"

namespace Mist{
class OutSRT : public HTTPOutput{
class OutSubRip : public HTTPOutput{
public:
OutSRT(Socket::Connection &conn);
~OutSRT();
OutSubRip(Socket::Connection &conn);
~OutSubRip();
static void init(Util::Config *cfg);
void onHTTP();
void sendNext();
Expand All @@ -19,4 +19,4 @@ namespace Mist{
};
}// namespace Mist

typedef Mist::OutSRT mistOut;
typedef Mist::OutSubRip mistOut;