- Content::examine (film, job, quick);
-
- shared_ptr<FFmpegDecoder> decoder (new FFmpegDecoder (film, shared_from_this (), true, false, false));
-
- ContentVideoFrame video_length = 0;
- if (quick) {
- video_length = decoder->video_length ();
- film->log()->log (String::compose ("Video length obtained from header as %1 frames", decoder->video_length ()));
- } else {
- while (!decoder->pass ()) {
- /* keep going */
- }
-
- video_length = decoder->video_frame ();
- film->log()->log (String::compose ("Video length examined as %1 frames", decoder->video_frame ()));
- }
-
- {
- boost::mutex::scoped_lock lm (_mutex);
-
- _video_length = video_length;
-
- _subtitle_streams = decoder->subtitle_streams ();
- if (!_subtitle_streams.empty ()) {
- _subtitle_stream = _subtitle_streams.front ();
- }
-
- _audio_streams = decoder->audio_streams ();
- if (!_audio_streams.empty ()) {
- _audio_stream = _audio_streams.front ();
- }
- }
-
- take_from_video_decoder (decoder);
-
- signal_changed (VideoContentProperty::VIDEO_LENGTH);
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAMS);
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
- signal_changed (FFmpegContentProperty::AUDIO_STREAMS);
- signal_changed (FFmpegContentProperty::AUDIO_STREAM);
- signal_changed (AudioContentProperty::AUDIO_CHANNELS);
+ Content::examine (job);
+
+ shared_ptr<const Film> film = _film.lock ();
+ assert (film);
+
+ shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (shared_from_this ()));
+
+ VideoContent::Frame video_length = 0;
+ video_length = examiner->video_length ();
+ LOG_GENERAL ("Video length obtained from header as %1 frames", video_length);
+
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+
+ _video_length = video_length;
+
+ _subtitle_streams = examiner->subtitle_streams ();
+ if (!_subtitle_streams.empty ()) {
+ _subtitle_stream = _subtitle_streams.front ();
+ }
+
+ _audio_streams = examiner->audio_streams ();
+ if (!_audio_streams.empty ()) {
+ _audio_stream = _audio_streams.front ();
+ }
+
+ _first_video = examiner->first_video ();
+ }
+
+ take_from_video_examiner (examiner);
+
+ signal_changed (ContentProperty::LENGTH);
+ signal_changed (FFmpegContentProperty::SUBTITLE_STREAMS);
+ signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
+ signal_changed (FFmpegContentProperty::AUDIO_STREAMS);
+ signal_changed (FFmpegContentProperty::AUDIO_STREAM);
+ signal_changed (AudioContentProperty::AUDIO_CHANNELS);