]> git.sesse.net Git - casparcg/commitdiff
2.0. ffmpeg_producer: Fixed input buffer limit.
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 10 Aug 2011 14:11:55 +0000 (14:11 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Wed, 10 Aug 2011 14:11:55 +0000 (14:11 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1126 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

modules/ffmpeg/producer/input.cpp

index 3a9565a826e86ab93d60faee182818516479d76e..6cb8598581ae2946e1bf51b9c984ee5bf5aab0d6 100644 (file)
@@ -237,7 +237,7 @@ private:
 \r
        bool full() const\r
        {\r
-               return is_running_ && buffer_size_ > MAX_BUFFER_SIZE && buffer_.size() > MAX_BUFFER_COUNT;\r
+               return is_running_ && (buffer_size_ > MAX_BUFFER_SIZE || buffer_.size() > MAX_BUFFER_COUNT);\r
        }\r
 \r
        void seek_frame(int64_t frame, int flags = 0)\r
@@ -249,11 +249,11 @@ private:
        bool is_eof(int ret)\r
        {\r
                if(ret == AVERROR(EIO))\r
-                       CASPAR_LOG(debug) << print() << " Received EIO, assuming EOF.";\r
-               //if(ret == AVERROR_EOF)\r
-               //      CASPAR_LOG(info) << print() << " Received EOF.";\r
+                       CASPAR_LOG(debug) << print() << " Received EIO, assuming EOF. " << nb_frames_;\r
+               if(ret == AVERROR_EOF)\r
+                       CASPAR_LOG(info) << print() << " Received EOF. " << nb_frames_;\r
 \r
-               return ret == AVERROR_EOF || ret == AVERROR(EIO); // av_read_frame doesn't always correctly return AVERROR_EOF;\r
+               return nb_frames_ > 0 && (ret == AVERROR_EOF || ret == AVERROR(EIO)); // av_read_frame doesn't always correctly return AVERROR_EOF;\r
        }\r
        \r
        std::wstring print() const\r