Skip to content
Permalink
Browse files

VideoPlayer: strip rtmp options from file name

  • Loading branch information...
FernetMenta committed Aug 19, 2016
1 parent de71b7a commit 4554c9b757a1b017e7cbe9e23b5f6e24893f1215
@@ -242,3 +242,21 @@ CURL CDVDInputStreamFFmpeg::GetM3UBestBandwidthStream(const CURL &url, size_t ba
subStreamUrl.SetProtocolOptions(url.GetProtocolOptions());
return subStreamUrl;
}

std::string CDVDInputStreamFFmpeg::GetFileName()
{
CURL url = GetURL();
// rtmp options
if (url.IsProtocol("rtmp") || url.IsProtocol("rtmpt") ||
url.IsProtocol("rtmpe") || url.IsProtocol("rtmpte") ||
url.IsProtocol("rtmps"))
{
std::vector<std::string> opts = StringUtils::Split(url.Get(), " ");
if (opts.size() > 0)
{
return opts.front();
}
return url.Get();
}
return CDVDInputStream::GetFileName();
}
@@ -28,21 +28,22 @@ class CDVDInputStreamFFmpeg
public:
CDVDInputStreamFFmpeg(const CFileItem& fileitem);
virtual ~CDVDInputStreamFFmpeg();
virtual bool Open();
virtual void Close();
virtual int Read(uint8_t* buf, int buf_size);
virtual int64_t Seek(int64_t offset, int whence);
virtual bool Pause(double dTime) { return false; };
virtual bool IsEOF();
virtual int64_t GetLength();

virtual void Abort() { m_aborted = true; }
virtual bool Open() override;
virtual void Close() override;
virtual int Read(uint8_t* buf, int buf_size) override;
virtual int64_t Seek(int64_t offset, int whence) override;
virtual bool Pause(double dTime) override { return false; };
virtual bool IsEOF() override;
virtual int64_t GetLength() override;
std::string GetFileName() override;

virtual void Abort() override { m_aborted = true; }
bool Aborted() { return m_aborted; }

const CFileItem& GetItem() const { return m_item; }

bool CanSeek() { return m_can_seek; }
bool CanPause() { return m_can_pause; }
bool CanSeek() override { return m_can_seek; }
bool CanPause() override { return m_can_pause; }

std::string GetProxyType() const;
std::string GetProxyHost() const;

0 comments on commit 4554c9b

Please sign in to comment.
You can’t perform that action at this time.