summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-08-13 17:37:52 +0100
committerCarl Hetherington <cth@carlh.net>2018-08-14 00:05:06 +0100
commit1fe6bd7f8ba059322b8357b2210f0fd590567ce2 (patch)
tree2c76fbf24b9b520f94f741040f11dc920d3bab91 /src/lib/ffmpeg_content.cc
parentf30ad4dec0a3fa5f1770fba93106a3e8910d66ba (diff)
More fixes for errors / crashes / misbehaviour with content changes
and the butler. Here we signal both before and after a change in content. Before, the player disables itself so that any pass()/seek() will be no-ops. After, the player rebuilds its pieces and the butler re-seeks to get back to where it was before the change.
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
-rw-r--r--src/lib/ffmpeg_content.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index ebcbcc47e..05b6ae8ea 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -251,6 +251,9 @@ FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
void
FFmpegContent::examine (shared_ptr<Job> job)
{
+ ContentChange cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS);
+ ContentChange cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM);
+
job->set_progress_unknown ();
Content::examine (job);
@@ -313,9 +316,6 @@ FFmpegContent::examine (shared_ptr<Job> job)
if (examiner->has_video ()) {
set_default_colour_conversion ();
}
-
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAMS);
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
string
@@ -369,12 +369,12 @@ FFmpegContent::technical_summary () const
void
FFmpegContent::set_subtitle_stream (shared_ptr<FFmpegSubtitleStream> s)
{
+ ContentChange cc (this, FFmpegContentProperty::SUBTITLE_STREAM);
+
{
boost::mutex::scoped_lock lm (_mutex);
_subtitle_stream = s;
}
-
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
bool
@@ -410,12 +410,12 @@ FFmpegContent::full_length () const
void
FFmpegContent::set_filters (vector<Filter const *> const & filters)
{
+ ContentChange cc (this, FFmpegContentProperty::FILTERS);
+
{
boost::mutex::scoped_lock lm (_mutex);
_filters = filters;
}
-
- signal_changed (FFmpegContentProperty::FILTERS);
}
string
@@ -629,7 +629,8 @@ FFmpegContent::add_properties (list<UserProperty>& p) const
void
FFmpegContent::signal_subtitle_stream_changed ()
{
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
+ /* XXX: this is too late; really it should be before the change */
+ ContentChange cc (this, FFmpegContentProperty::SUBTITLE_STREAM);
}
vector<shared_ptr<FFmpegAudioStream> >