summaryrefslogtreecommitdiff
path: root/src/lib/transcoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-10 22:20:39 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-10 22:20:39 +0000
commite9d0d7bf9871b7e7fa8d154535cf0bbc7e7bd466 (patch)
tree8d0a7a5c83eaa8cc5899b72151ab68ef0e5a8914 /src/lib/transcoder.cc
parent6a77e41813c542f6f6a6c528941d4b2bdc7eb3ca (diff)
Try to allow users to specify that the film's header should be trusted wrt length when building thumbnails, thus speeding up examine-content by a factor of 2-ish.
Diffstat (limited to 'src/lib/transcoder.cc')
-rw-r--r--src/lib/transcoder.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc
index 537b9b664..a7e79b05f 100644
--- a/src/lib/transcoder.cc
+++ b/src/lib/transcoder.cc
@@ -64,7 +64,9 @@ Transcoder::Transcoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j,
/* Set up the decoder to use the film's set streams */
_decoders.first->set_subtitle_stream (f->subtitle_stream ());
- _decoders.second->set_audio_stream (f->audio_stream ());
+ if (_decoders.second) {
+ _decoders.second->set_audio_stream (f->audio_stream ());
+ }
if (_matcher) {
_decoders.first->connect_video (_matcher);
@@ -73,7 +75,7 @@ Transcoder::Transcoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j,
_decoders.first->connect_video (_encoder);
}
- if (_matcher && _delay_line) {
+ if (_matcher && _delay_line && _decoders.second) {
_decoders.second->connect_audio (_delay_line);
_delay_line->connect_audio (_matcher);
_matcher->connect_audio (_gain);
@@ -97,7 +99,7 @@ Transcoder::go ()
_decoders.first->set_progress ();
}
- if (!done[1] && dynamic_pointer_cast<Decoder> (_decoders.second) != dynamic_pointer_cast<Decoder> (_decoders.first)) {
+ if (!done[1] && _decoders.second && dynamic_pointer_cast<Decoder> (_decoders.second) != dynamic_pointer_cast<Decoder> (_decoders.first)) {
done[1] = _decoders.second->pass ();
} else {
done[1] = true;