diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-24 22:11:41 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-24 22:11:41 +0000 |
| commit | d3d503bc046c1c317951d239e7cdb41e8f695b66 (patch) | |
| tree | e67de6bc8069e90048f9e0bd3a8b3694ad50f50e /src/lib/video_decoder.cc | |
| parent | 1c45aa5806a0891025eb4729b9e0c8cfb9c68e44 (diff) | |
Reduce variable scope slightly.
Diffstat (limited to 'src/lib/video_decoder.cc')
| -rw-r--r-- | src/lib/video_decoder.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index fd5779a65..1f2452460 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -242,11 +242,6 @@ VideoDecoder::video (shared_ptr<const ImageProxy> image, Frame frame) _video_content->film()->log()->log (String::compose ("VD receives %1", frame), LogEntry::TYPE_DEBUG_DECODE); - /* We may receive the same frame index twice for 3D, and we need to know - when that happens. - */ - bool const same = (!_decoded_video.empty() && frame == _decoded_video.back().frame); - /* Work out what we are going to push into _decoded_video next */ list<ContentVideo> to_push; switch (_video_content->video_frame_type ()) { @@ -254,8 +249,14 @@ VideoDecoder::video (shared_ptr<const ImageProxy> image, Frame frame) to_push.push_back (ContentVideo (image, EYES_BOTH, PART_WHOLE, frame)); break; case VIDEO_FRAME_TYPE_3D_ALTERNATE: + { + /* We receive the same frame index twice for 3D-alternate; hence we know which + frame this one is. + */ + bool const same = (!_decoded_video.empty() && frame == _decoded_video.back().frame); to_push.push_back (ContentVideo (image, same ? EYES_RIGHT : EYES_LEFT, PART_WHOLE, frame)); break; + } case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: to_push.push_back (ContentVideo (image, EYES_LEFT, PART_LEFT_HALF, frame)); to_push.push_back (ContentVideo (image, EYES_RIGHT, PART_RIGHT_HALF, frame)); |
