[FFmpeg-devel] [PATCH] lavfi: skip the frame in case of error.

Clément Bœsch ubitux at gmail.com
Tue Dec 13 15:56:46 CET 2011


From: Clément Bœsch <clement.boesch at smartjog.com>

This fixes playback with some audio files through filters.
---
Note: to be applied on top of the previous patch (lavfi new API). The issue is
also present with the old API.
---
 libavfilter/src_movie.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 7851190..d45a45a 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -402,8 +402,10 @@ static int amovie_get_samples(AVFilterLink *outlink)
     /* decode and update the movie pkt */
     avcodec_get_frame_defaults(movie->frame);
     ret = avcodec_decode_audio4(movie->codec_ctx, movie->frame, &got_frame, &movie->pkt);
-    if (ret < 0)
-        return ret;
+    if (ret < 0) {
+        movie->pkt.size = 0;
+        return 0;
+    }
     movie->pkt.data += ret;
     movie->pkt.size -= ret;
 
-- 
1.7.7.3



More information about the ffmpeg-devel mailing list