diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-04-18 20:42:58 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-19 00:57:23 +0200 |
| commit | 6e003ef110717dd3e4ecdb009d33671f7834e024 (patch) | |
| tree | 575c073e8a06bd20cf9fd5d99aab9db3164e75cd /src/lib/reel_writer.cc | |
| parent | be4082c68004d56ad7f14b7b9cddef640118dd62 (diff) | |
Add _last_written to Writer, containing the last written frame and eyes
to each reel. This is updated when things are popped off the queue, with
_state_mutex_held, and used in preference to the ones in ReelWriter
which were previously being updated during the time the _state_mutex
lock is unlocked in the body of Writer::thread(). This was not
thread safe (thanks, valgrind!)
Diffstat (limited to 'src/lib/reel_writer.cc')
| -rw-r--r-- | src/lib/reel_writer.cc | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 49e09663f..06d20e7c8 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -71,8 +71,6 @@ ReelWriter::ReelWriter ( ) : _film (film) , _period (period) - , _last_written_video_frame (-1) - , _last_written_eyes (EYES_RIGHT) , _reel_index (reel_index) , _reel_count (reel_count) , _content_summary (content_summary) @@ -266,12 +264,10 @@ ReelWriter::write (optional<Data> encoded, Frame frame, Eyes eyes) dcp::FrameInfo fin = _picture_asset_writer->write (encoded->data().get (), encoded->size()); write_frame_info (frame, eyes, fin); _last_written[eyes] = encoded; - _last_written_video_frame = frame; - _last_written_eyes = eyes; } void -ReelWriter::fake_write (Frame frame, Eyes eyes, int size) +ReelWriter::fake_write (int size) { if (!_picture_asset_writer) { /* We're not writing any data */ @@ -279,8 +275,6 @@ ReelWriter::fake_write (Frame frame, Eyes eyes, int size) } _picture_asset_writer->fake_write (size); - _last_written_video_frame = frame; - _last_written_eyes = eyes; } void @@ -296,8 +290,6 @@ ReelWriter::repeat_write (Frame frame, Eyes eyes) _last_written[eyes]->size() ); write_frame_info (frame, eyes, fin); - _last_written_video_frame = frame; - _last_written_eyes = eyes; } void |
