[FFmpeg-cvslog] avconv: do not stop processing the input packet on decoding error

Anton Khirnov git at videolan.org
Sat Jun 27 20:41:29 CEST 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed May  6 13:55:38 2015 +0200| [9a5e4fbec870c7d466b7a0aec92c70778efc96b5] | committer: Anton Khirnov

avconv: do not stop processing the input packet on decoding error

We still want to flush the filters on EOF and possibly apply streamcopy.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9a5e4fbec870c7d466b7a0aec92c70778efc96b5
---

 avconv.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/avconv.c b/avconv.c
index 4aa40a8..5efa80d 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1358,7 +1358,7 @@ static int send_filter_eof(InputStream *ist)
 }
 
 /* pkt = NULL means EOF (needed to flush decoder buffers) */
-static int process_input_packet(InputStream *ist, const AVPacket *pkt)
+static void process_input_packet(InputStream *ist, const AVPacket *pkt)
 {
     int i;
     int got_output;
@@ -1415,11 +1415,17 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
             ret = transcode_subtitles(ist, &avpkt, &got_output);
             break;
         default:
-            return -1;
+            return;
+        }
+
+        if (ret < 0) {
+            av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d\n",
+                   ist->file_index, ist->st->index);
+            if (exit_on_error)
+                exit_program(1);
+            break;
         }
 
-        if (ret < 0)
-            return ret;
         // touch data and size only if not EOF
         if (pkt) {
             avpkt.data += ret;
@@ -1466,7 +1472,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt)
         do_streamcopy(ist, ost, pkt);
     }
 
-    return 0;
+    return;
 }
 
 static void print_sdp(void)
@@ -2481,13 +2487,7 @@ static int process_input(void)
         }
     }
 
-    ret = process_input_packet(ist, &pkt);
-    if (ret < 0) {
-        av_log(NULL, AV_LOG_ERROR, "Error while decoding stream #%d:%d\n",
-               ist->file_index, ist->st->index);
-        if (exit_on_error)
-            exit_program(1);
-    }
+    process_input_packet(ist, &pkt);
 
 discard_packet:
     av_free_packet(&pkt);



More information about the ffmpeg-cvslog mailing list