]> git.sesse.net Git - casparcg/blobdiff - modules/ffmpeg/producer/audio/audio_decoder.cpp
[ffmpeg] Copied flush logic when seeking from 2.0, as well as current frame in clip...
[casparcg] / modules / ffmpeg / producer / audio / audio_decoder.cpp
index 2366c10d8032260be15a9ca11197455926c528ce..e92a7c18134859e05370fc65b13e6fb18a5d720e 100644 (file)
@@ -108,17 +108,17 @@ public:
                
                std::shared_ptr<AVFrame> audio;
 
-               if(!current_packet_)    
-               {
-                       avcodec_flush_buffers(codec_context_.get());    
-               }
-               else if(!current_packet_->data)
+               if (!current_packet_->data)
                {
                        if(codec_context_->codec->capabilities & CODEC_CAP_DELAY)                       
                                audio = decode(*current_packet_);
                        
-                       if(!audio)
+                       if (!audio)
+                       {
+                               avcodec_flush_buffers(codec_context_.get());
                                current_packet_.reset();
+                               audio = flush();
+                       }
                }
                else
                {