Don't take into account audio decoders with no audio when updating audio_done_up_to...
authorCarl Hetherington <cth@carlh.net>
Tue, 14 Jan 2014 22:16:19 +0000 (22:16 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 14 Jan 2014 22:16:19 +0000 (22:16 +0000)
ChangeLog
src/lib/player.cc

index fd2061a14eb378953823dc33187d0260c1030ca4..99ef9f218074b6e48f28ed7d4f8f8d35ea935988 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-01-14  Carl Hetherington  <cth@carlh.net>
 
+       * Fix problems with adding new soundtracks to FFmpeg content with
+       no audio track.
+
        * Updated de_DE translation from Markus Raab.
 
        * Version 1.63.1 released.
index 56145f5bdec1f7a6fa7cd218702d8f211d98907b..ce51097334be3e6a48107033e8446568d2dc0c4f 100644 (file)
@@ -224,7 +224,8 @@ Player::pass ()
                                continue;
                        }
 
-                       if (dynamic_pointer_cast<AudioDecoder> ((*i)->decoder)) {
+                       shared_ptr<AudioDecoder> ad = dynamic_pointer_cast<AudioDecoder> ((*i)->decoder);
+                       if (ad && ad->has_audio ()) {
                                audio_done_up_to = min (audio_done_up_to.get_value_or (TIME_MAX), (*i)->audio_position);
                        }
                }