[FFmpeg-devel] [PATCH 3/4] ffmpeg: use av_buffersrc_close().

Nicolas George george at nsup.org
Wed Jul 30 23:44:48 CEST 2014


Signed-off-by: Nicolas George <george at nsup.org>
---
 ffmpeg.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 1c1a559..3ac6620 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1741,12 +1741,9 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
 
     if (!*got_output || ret < 0) {
         if (!pkt->size) {
+            int64_t pts = av_rescale_q(ist->next_pts, AV_TIME_BASE_Q, ist->st->time_base);
             for (i = 0; i < ist->nb_filters; i++)
-#if 1
-                av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
-#else
-                av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-#endif
+                av_buffersrc_close(ist->filters[i]->filter, pts, 0);
         }
         return ret;
     }
@@ -1894,12 +1891,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
 
     if (!*got_output || ret < 0) {
         if (!pkt->size) {
+            int64_t pts = av_rescale_q(ist->next_pts, AV_TIME_BASE_Q, ist->st->time_base);
             for (i = 0; i < ist->nb_filters; i++)
-#if 1
-                av_buffersrc_add_ref(ist->filters[i]->filter, NULL, 0);
-#else
-                av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-#endif
+                av_buffersrc_close(ist->filters[i]->filter, pts, 0);
         }
         return ret;
     }
-- 
2.0.1



More information about the ffmpeg-devel mailing list