Don't decode things if they are not enabled.
authorCarl Hetherington <cth@carlh.net>
Sun, 14 Jul 2013 22:48:10 +0000 (23:48 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 14 Jul 2013 22:48:10 +0000 (23:48 +0100)
src/lib/player.cc

index c8c2064248a941560b22f6684e9121f7098ead37..8fd5715d4427c17ec4f80c70d41bf6ae35dd796c 100644 (file)
@@ -138,7 +138,7 @@ Player::pass ()
                        continue;
                }
 
-               if (dynamic_pointer_cast<VideoDecoder> ((*i)->decoder)) {
+               if (_video && dynamic_pointer_cast<VideoDecoder> ((*i)->decoder)) {
                        if ((*i)->video_position < earliest_t) {
                                earliest_t = (*i)->video_position;
                                earliest = *i;
@@ -146,7 +146,7 @@ Player::pass ()
                        }
                }
 
-               if (dynamic_pointer_cast<AudioDecoder> ((*i)->decoder)) {
+               if (_audio && dynamic_pointer_cast<AudioDecoder> ((*i)->decoder)) {
                        if ((*i)->audio_position < earliest_t) {
                                earliest_t = (*i)->audio_position;
                                earliest = *i;