Skip to content

Commit

Permalink
Total hack. Simply disable m_mailbox, to allow for GCC 4.6 compat.
Browse files Browse the repository at this point in the history
util/Mailbox.h and util/FunctorIterator.h use template aliases, which
are not supported until GCC 4.7. Just kill off m_mailbox for now, and
maybe consider another solution later.
  • Loading branch information
gstein committed Apr 17, 2013
1 parent 0ad039d commit a8586fb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
26 changes: 26 additions & 0 deletions OMXPlayerSubtitles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ bool OMXPlayerSubtitles::Open(size_t stream_count,
if(!Create())
return false;

#if 0
m_mailbox.send(Message::Flush{m_external_subtitles});
#endif

#ifndef NDEBUG
m_open = true;
Expand All @@ -96,11 +98,15 @@ void OMXPlayerSubtitles::Close() BOOST_NOEXCEPT
{
if(Running())
{
#if 0
m_mailbox.send(Message::Stop{});
#endif
StopThread();
}

#if 0
m_mailbox.clear();
#endif
m_subtitle_buffers.clear();

#ifndef NDEBUG
Expand Down Expand Up @@ -222,6 +228,7 @@ RenderLoop(const string& font_path,
0, 1000);
}

#if 0
m_mailbox.receive_wait(chrono::milliseconds(timeout),
[&](Message::Push&& args)
{
Expand Down Expand Up @@ -249,6 +256,7 @@ RenderLoop(const string& font_path,
{
exit = true;
});
#endif

if(exit) break;

Expand Down Expand Up @@ -296,15 +304,19 @@ void OMXPlayerSubtitles::FlushRenderer()

if(GetUseExternalSubtitles())
{
#if 0
m_mailbox.send(Message::Flush{m_external_subtitles});
#endif
}
else
{
Message::Flush flush;
assert(!m_subtitle_buffers.empty());
for(auto& s : m_subtitle_buffers[m_active_index])
flush.subtitles.push_back(s);
#if 0
m_mailbox.send(move(flush));
#endif
}
}

Expand All @@ -317,10 +329,12 @@ void OMXPlayerSubtitles::Flush(double pts) BOOST_NOEXCEPT

if(GetVisible())
{
#if 0
if(GetUseExternalSubtitles())
m_mailbox.send(Message::Seek{static_cast<int>(pts/1000)});
else
m_mailbox.send(Message::Flush{});
#endif
}
}

Expand All @@ -329,15 +343,19 @@ void OMXPlayerSubtitles::Resume() BOOST_NOEXCEPT
assert(m_open);

m_paused = false;
#if 0
m_mailbox.send(Message::SetPaused{false});
#endif
}

void OMXPlayerSubtitles::Pause() BOOST_NOEXCEPT
{
assert(m_open);

m_paused = true;
#if 0
m_mailbox.send(Message::SetPaused{true});
#endif
}

void OMXPlayerSubtitles::SetUseExternalSubtitles(bool use) BOOST_NOEXCEPT
Expand All @@ -355,7 +373,9 @@ void OMXPlayerSubtitles::SetDelay(int value) BOOST_NOEXCEPT
assert(m_open);

m_delay = value;
#if 0
m_mailbox.send(Message::SetDelay{value});
#endif
}

void OMXPlayerSubtitles::SetVisible(bool visible) BOOST_NOEXCEPT
Expand All @@ -375,7 +395,9 @@ void OMXPlayerSubtitles::SetVisible(bool visible) BOOST_NOEXCEPT
if(m_visible)
{
m_visible = false;
#if 0
m_mailbox.send(Message::Flush{});
#endif
}
}
}
Expand Down Expand Up @@ -436,11 +458,13 @@ bool OMXPlayerSubtitles::AddPacket(OMXPacket *pkt, size_t stream_index) BOOST_NO
return true;
}

#if 0
if(pkt->hints.codec != AV_CODEC_ID_SUBRIP &&
pkt->hints.codec != AV_CODEC_ID_SSA)
{
return true;
}
#endif

auto start = static_cast<int>(pkt->pts/1000);
auto stop = start + static_cast<int>(pkt->duration/1000);
Expand All @@ -460,7 +484,9 @@ bool OMXPlayerSubtitles::AddPacket(OMXPacket *pkt, size_t stream_index) BOOST_NO
GetVisible() &&
stream_index == GetActiveStream())
{
#if 0
m_mailbox.send(Message::Push{{start, stop, move(text_lines)}});
#endif
}

return true;
Expand Down
4 changes: 3 additions & 1 deletion OMXPlayerSubtitles.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "OMXClock.h"
#include "OMXOverlayCodecText.h"
#include "Subtitle.h"
#include "utils/Mailbox.h"
//#include "utils/Mailbox.h"

#include <boost/config.hpp>
#include <boost/circular_buffer.hpp>
Expand Down Expand Up @@ -122,12 +122,14 @@ class OMXPlayerSubtitles : public OMXThread
COMXOverlayCodecText m_subtitle_codec;
std::vector<Subtitle> m_external_subtitles;
std::vector<boost::circular_buffer<Subtitle>> m_subtitle_buffers;
#if 0
Mailbox<Message::Stop,
Message::Flush,
Message::Push,
Message::Seek,
Message::SetPaused,
Message::SetDelay> m_mailbox;
#endif
bool m_paused;
bool m_visible;
bool m_use_external_subtitles;
Expand Down

0 comments on commit a8586fb

Please sign in to comment.