shared_ptr<Playlist> playlist (new Playlist);
playlist->add (content);
shared_ptr<Player> player (new Player (_film, playlist));
+ player->set_ignore_video ();
int64_t const len = _film->length().frames (_film->audio_frame_rate());
_samples_per_point = max (int64_t (1), len / _num_points);
int const si = _packet.stream_index;
- if (si == _video_stream) {
+ if (si == _video_stream && !_ignore_video) {
decode_video_packet ();
} else if (_ffmpeg_content->audio_stream() && _ffmpeg_content->audio_stream()->uses_index (_format_context, si)) {
decode_audio_packet ();
, _playlist (p)
, _have_valid_pieces (false)
, _approximate_size (false)
+ , _ignore_video (false)
{
_playlist_changed_connection = _playlist->Changed.connect (bind (&Player::playlist_changed, this));
_playlist_content_changed_connection = _playlist->ContentChanged.connect (bind (&Player::content_changed, this, _1, _2, _3));
frc = best_overlap_frc;
}
+ shared_ptr<VideoDecoder> vd = dynamic_pointer_cast<VideoDecoder> (decoder);
+ if (vd && _ignore_video) {
+ vd->set_ignore_video ();
+ }
+
_pieces.push_back (shared_ptr<Piece> (new Piece (*i, decoder, frc.get ())));
}
return fonts;
}
+
+/** Set this player never to produce any video data */
+void
+Player::set_ignore_video ()
+{
+ _ignore_video = true;
+}
void set_video_container_size (dcp::Size);
void set_approximate_size ();
+ void set_ignore_video ();
PlayerStatistics const & statistics () const;
boost::shared_ptr<Image> _black_image;
bool _approximate_size;
+ /** true if the player should ignore all video; i.e. never produce any */
+ bool _ignore_video;
PlayerStatistics _statistics;
: _video_content (c)
#endif
, _last_seek_accurate (true)
+ , _ignore_video (false)
{
_black_image.reset (new Image (PIX_FMT_RGB24, _video_content->video_size(), true));
_black_image->make_black ();
void
VideoDecoder::video (shared_ptr<const ImageProxy> image, VideoFrame frame)
{
+ if (_ignore_video) {
+ return;
+ }
+
/* We may receive the same frame index twice for 3D, and we need to know
when that happens.
*/
_last_seek_time = s;
_last_seek_accurate = accurate;
}
+
+/** Set this player never to produce any video data */
+void
+VideoDecoder::set_ignore_video ()
+{
+ _ignore_video = true;
+}
return _video_content;
}
+ void set_ignore_video ();
+
#ifdef DCPOMATIC_DEBUG
int test_gaps;
#endif
boost::shared_ptr<Image> _black_image;
boost::optional<ContentTime> _last_seek_time;
bool _last_seek_accurate;
+
+ /** true if this decoder should ignore all video; i.e. never produce any */
+ bool _ignore_video;
};
#endif