]> git.sesse.net Git - casparcg/blobdiff - modules/ffmpeg/producer/util/util.cpp
[ffmpeg] Copied flush logic when seeking from 2.0, as well as current frame in clip...
[casparcg] / modules / ffmpeg / producer / util / util.cpp
index 3546305f55ae61eeee43b1dd0d33a08b249c96ed..eb773c6c115f5818572bdee16ddd1072e409a4ba 100644 (file)
@@ -491,6 +491,16 @@ spl::shared_ptr<AVFrame> create_frame()
        return frame;
 }
 
+std::shared_ptr<AVFrame> flush()
+{
+       static std::shared_ptr<AVFrame> dummy(av_frame_alloc(), [](AVFrame* p)
+       {
+               av_frame_free(&p);
+       });
+
+       return dummy;
+}
+
 spl::shared_ptr<AVCodecContext> open_codec(AVFormatContext& context, enum AVMediaType type, int& index, bool single_threaded)
 {      
        AVCodec* decoder;