summaryrefslogtreecommitdiff
path: root/src/lib/player.cc
AgeCommit message (Collapse)Author
2020-01-28Fix deadlock during content examination.Carl Hetherington
Before this fix, the following situation could happen in threads A and B: A: Some DONE signal happens; this triggers setup_pieces which takes a lock on the player mutex. B: FFmpegContent::examine takes a lock on the content mutex. B: FFmpegContent::examine adds a stream B: That causes STREAMS PENDING to be emitted. B: This tries to take a lock on the player mutex so it can update _suspended A: setup_pieces tries to access some content information, hence tries to take a lock on the content mutex. Now B is holding the CL and awaiting the PL and A is holding the PL and awaiting the CL. It feels like the root cause of this is that while setup_pieces is happening another change (which would itself cause setup_pieces) is announced, and this isn't dealt with properly. There are two steps here; _suspended is protected with an atomic rather than using _mutex, and also it can cope with being updated recursively.
2020-01-25Cache film length for Player::pass.Carl Hetherington
2020-01-07Extend the amount of allowed disagreement between the audioCarl Hetherington
coming from the content and the calculated periods of silence. It sees that there is some scope for disagreements here when trim start/end times are rounded to frame boundaries. Fixes #1708.
2019-11-11Fix comment.Carl Hetherington
2019-11-01Increase fudge factor at the boundary between audio signal and silence.Carl Hetherington
2019-09-20Add a warning log when an assertion gets hit.Carl Hetherington
Forward-ported from 4141f01e25abd5050db09ff85da47ff059909669 in master.
2019-09-09Stop crashing when running the hints check on films with silent/black gaps.Carl Hetherington
2019-08-31Primitive subtitle export feature.v2.15.16Carl Hetherington
2019-08-30Make player more tolerant of some DCP errors.Carl Hetherington
2019-07-31Avoid random black gaps between bits of content A and B whenv2.15.15Carl Hetherington
content B has had its start trimmed. In this case when we seek inaccurately in A we previously also seeked inaccurately in B. This meant that at the transition the first frame we see of B may not be the first frame of B. After this we seek accurately in B so that we definitely get to the start of it. This is especially important if the start of B has been trimmed to within two keyframes so that an inaccurate seek is not sufficient.
2019-07-25Optimise decoder_factory for DCPDecoder by offering the old decoderCarl Hetherington
(if available) to recover the list of reels from, rather than having to scan the filesystem again.
2019-07-24Re-work idle handling from previous commit.Carl Hetherington
2019-05-26Potential fix for #1568; we calculate the remaining DCPTime butCarl Hetherington
then convert it back to resampled content frames using the DCP rate rather than the resampled content rate, which seems wrong. If we want to go from metric time to frames we surely have to use the frame rate of the thing we are working with (not the frame rate which that thing will be played back at).
2019-05-24Basic ability to set video range (JPEG/MPEG) at least for YUV content. May ↵Carl Hetherington
not work for RGB. See #1509.
2019-05-10Put Time types in dcpomatic namespace.Carl Hetherington
2019-05-10libdcp API fixes.Carl Hetherington
2019-04-17Fix errors when adding reels containing audio after referenced reels (#1528).v2.13.147Carl Hetherington
2019-03-23Another attempt to fix build.v2.13.135Carl Hetherington
2019-03-23Try to fix Windows build.Carl Hetherington
2019-03-22Fix referencing of trimmed multi-reel DCPs (#1495).Carl Hetherington
2019-03-13Only mark _suspended as false at the appropriate times; previouslyv2.13.130Carl Hetherington
it was done too often, I think.
2019-02-07Bodge at the interface between DCPTime and samples; fixes #1461.Carl Hetherington
2019-01-10Only fill video gaps if they are at least half a frame in length.Carl Hetherington
Fixes lack of image (sometimes) when trimming drop-frame content.
2019-01-10Fix a crash due the assertion in emit_audio failing when applyingCarl Hetherington
trims which do not land precisely on a DCP audio sample boundary (at least, I think that's what triggers it).
2018-12-22Fix assumption of 48kHz DCP audio in AudioRingBuffers consistency check (#1436).Carl Hetherington
2018-11-21Tidy and fix logging.Carl Hetherington
2018-11-21Add and use new FrameRateChange constructors.Carl Hetherington
2018-11-21Put Film pointer into Decoder.Carl Hetherington
2018-11-21Take Film pointer out of Content.Carl Hetherington
2018-09-04Build Empty objects from the presence or absence of decoders inCarl Hetherington
Pieces, rather than the presence or absence of content. This seems better because of cases like encrypted DCPs without a a KDM: here we may have content but no decoder.
2018-09-02Remove unnecessary subtitle scale (I think).Carl Hetherington
2018-09-02Fix subtitle scaling when writing PNG subs.Carl Hetherington
2018-08-29Missing handling of CHANGE_TYPE_CANCELLED causing another hang.v2.13.46Carl Hetherington
2018-08-29Basics of splitting CCAP streams into different assets.Carl Hetherington
2018-08-23Remove TextType from various places as (I believe) it can be inferred from ↵Carl Hetherington
the content.
2018-08-22Fix hang due to incorrect signal ordering.Carl Hetherington
2018-08-22Fix build with multiple closed captions.Carl Hetherington
2018-08-20MIssing PENDING/CANCELLED for VIDEO_CONTAINER_SIZE. Fix 3D fill with 2D ↵Carl Hetherington
sources.
2018-08-19Similar pending/done for Film::Change.Carl Hetherington
2018-08-19Replace May/Done/NotDone signal sets with one signal and extendCarl Hetherington
this treatment to anything that caused Player::setup_pieces. This should fix out-of-sequence Player emissions caused by setup_pieces being called by one thread while the butler is calling pass().
2018-08-19Suspend butler on player may-change as otherwise there's a windowCarl Hetherington
between Player::_suspended being set to false and the the butler requesting a seek, during which the butler may call pass().
2018-08-14More fixes for errors / crashes / misbehaviour with content changesCarl Hetherington
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.
2018-08-10Use more direct route to fix hangs after calling some Player methods.Carl Hetherington
2018-08-10Try to fix Windows build.Carl Hetherington
2018-08-10Add some Changed() emissions so that when a butler is in controlCarl Hetherington
we always do a seek when we set _have_valid_pieces to false.
2018-08-09Fix writer assertion at the end of some 3D encodes; one too many fill frames ↵Carl Hetherington
were being emitted.
2018-08-09Rather dubious fix for crash due to the sequence:Carl Hetherington
- playlist change - _have_valid_pieces -> false - signal butler - but meanwhile, pass happens which calls setup_pieces and starts emitting data from time 0 - this new data is not in sync with what's already in the audio ring buffers
2018-08-05Get closed caption view data from the butler, rather than the player.Carl Hetherington
You can't introduce the butler (so that the player is ahead of time) and then ask the player what should be in the frame that is being displayed "now"; the player will already have moved on.
2018-08-04Some subtitle renaming.Carl Hetherington
2018-08-02A variety of changes to improve (but not entirely fix) behaviourCarl Hetherington
when moving content (or otherwise changing the playlist) while playing. This commit refills the butler when things change in certain ways, and improves locking to cope with Player methods being called from the GUI and butler threads at the same time.