Fix seek to zero.
authorCarl Hetherington <cth@carlh.net>
Tue, 25 Feb 2014 11:32:00 +0000 (11:32 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 25 Feb 2014 11:32:00 +0000 (11:32 +0000)
src/lib/ffmpeg_decoder.cc
src/lib/player.cc

index 4534de589693a21b7839009e9425325a821760c7..22e1b3bc19587e96b6c8a795a73eb4ee1d50a0a1 100644 (file)
@@ -374,6 +374,9 @@ FFmpegDecoder::seek_and_flush (ContentTime t)
 
        /* Ridiculous empirical hack */
        s--;
+       if (s < 0) {
+               s = 0;
+       }
 
        av_seek_frame (_format_context, _video_stream, s, AVSEEK_FLAG_BACKWARD);
 
index a8ba7cc536b5012cedab2d6f065f972578894a4c..3584e75cae8afb796928545f0a23c8036c367985 100644 (file)
@@ -173,6 +173,18 @@ Player::pass ()
        shared_ptr<DecodedImageSubtitle> dis = dynamic_pointer_cast<DecodedImageSubtitle> (earliest_decoded);
        shared_ptr<DecodedTextSubtitle> dts = dynamic_pointer_cast<DecodedTextSubtitle> (earliest_decoded);
 
+#if 0  
+       if (dv) {
+               cout << "Video @ " << dv->dcp_time << " " << (double(dv->dcp_time) / TIME_HZ) << ".\n";
+       } else if (da) {
+               cout << "Audio.\n";
+       } else if (dis) {
+               cout << "Image sub.\n";
+       } else if (dts) {
+               cout << "Text sub.\n";
+       }
+#endif 
+       
        /* Will be set to false if we shouldn't consume the peeked DecodedThing */
        bool consume = true;