]> git.sesse.net Git - casparcg/commitdiff
* Don't log underflow in ffmpeg producer while at EOF.
authorHelge Norberg <helge.norberg@svt.se>
Wed, 28 Oct 2015 14:05:51 +0000 (15:05 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Wed, 28 Oct 2015 14:05:51 +0000 (15:05 +0100)
modules/ffmpeg/producer/ffmpeg_producer.cpp
modules/ffmpeg/producer/input/input.cpp
modules/ffmpeg/producer/input/input.h

index 7896dce56ac6fe2656da6703d6751c60047c148a..813c933302d26c32cc76a52a6fa39483d5d0cf9f 100644 (file)
@@ -204,7 +204,7 @@ public:
                        last_frame_ = frame = std::move(muxer_->front());
                        muxer_->pop();
                }
-               else
+               else if (!input_.eof())
                        graph_->set_tag(diagnostics::tag_severity::WARNING, "underflow");
 
                graph_->set_value("frame-time", frame_timer.elapsed()*format_desc_.fps*0.5);
index 9a4befa0bd7f8f427c630e1d42cd4384092b926b..5e170d2404d15ed22a3b54241d822925ebb1182d 100644 (file)
@@ -118,6 +118,7 @@ struct input::impl : boost::noncopyable
        tbb::atomic<uint32_t>                                           start_;         
        tbb::atomic<uint32_t>                                           length_;
        tbb::atomic<bool>                                                       loop_;
+       tbb::atomic<bool>                                                       eof_;
        double                                                                          fps_                                    = read_fps(*format_context_, 0.0);
        uint32_t                                                                        frame_number_                   = 0;
 
@@ -138,6 +139,7 @@ struct input::impl : boost::noncopyable
                start_                  = start;
                length_                 = length;
                loop_                   = loop;
+               eof_                    = false;
                is_running_             = true;
 
                if(start_ != 0)
@@ -213,6 +215,7 @@ struct input::impl : boost::noncopyable
 private:
        void internal_seek(uint32_t target)
        {
+               eof_ = false;
                graph_->set_tag(diagnostics::tag_severity::INFO, "seek");
 
                CASPAR_LOG(debug) << print() << " Seeking: " << target;
@@ -265,6 +268,7 @@ private:
                        {
                                audio_stream_.push(packet);
                                video_stream_.push(packet);
+                               eof_ = true;
                        }
                }
                else
@@ -353,4 +357,5 @@ void input::start(uint32_t value){impl_->start_ = value;}
 uint32_t input::start() const{return impl_->start_;}
 void input::length(uint32_t value){impl_->length_ = value;}
 uint32_t input::length() const{return impl_->length_;}
+bool input::eof() const { return impl_->eof_; }
 }}
index 7bba5aa3af3a4ccb8f02462e7b1398f9308b0c1e..22a02ee46364fe339d7d36b2e99b56f356d3ffe1 100644 (file)
@@ -59,6 +59,8 @@ public:
        void            length(uint32_t value);
        uint32_t        length() const;
 
+       bool            eof() const;
+
        void            seek(uint32_t target);
 
        AVFormatContext& context();