- if (c->video) {
- video.reset (new VideoDecoder (this, c, log));
- }
- if (c->audio) {
- audio.reset (new AudioDecoder (this, c->audio, log, fast));
- }
- BOOST_FOREACH (shared_ptr<TextContent> i, c->text) {
- /* XXX: this time here should be the time of the first subtitle, not 0 */
- text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, i, log, ContentTime())));
+ if (content->can_be_played()) {
+ if (content->video) {
+ video = make_shared<VideoDecoder>(this, content);
+ }
+ if (content->audio) {
+ audio = make_shared<AudioDecoder>(this, content->audio, fast);
+ }
+ for (auto i: content->text) {
+ text.push_back (make_shared<TextDecoder>(this, i));
+ /* We should really call maybe_set_position() on this TextDecoder to set the time
+ * of the first subtitle, but it probably doesn't matter since we'll always
+ * have regularly occurring video (and maybe audio) content.
+ */
+ }
+ if (content->atmos) {
+ atmos = make_shared<AtmosDecoder>(this, content);
+ }