- try {
- o.reset (new Options (_film->dir ("thumbs"), ".png", ""));
- o->out_size = _film->size ();
- o->apply_crop = false;
- o->decode_audio = false;
- if (_film->length() > 0) {
- o->decode_video_skip = _film->length().get() / 128;
- } else {
- o->decode_video_skip = 0;
+ /* Set the film's length to either
+ a) a length judged by running through the content or
+ b) the length from a decoder's header.
+ */
+ if (!_film->trust_content_header()) {
+ /* Decode the content to get an accurate length */
+
+ /* We don't want to use any existing length here, as progress
+ will be messed up.
+ */
+ _film->unset_length ();
+ _film->set_crop (Crop ());
+
+ DecodeOptions o;
+ o.decode_audio = false;
+
+ Decoders decoders = decoder_factory (_film, o);
+
+ set_progress_unknown ();
+ while (!decoders.video->pass()) {
+ /* keep going */