[FFmpeg-cvslog] fftools/ffmpeg: handle error codes from process_input_packet()

Anton Khirnov git at videolan.org
Sat Jul 15 12:03:08 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Jul 12 19:49:43 2023 +0200| [464a5e8e7681267501cb4a5e96ad040522a67d4e] | committer: Anton Khirnov

fftools/ffmpeg: handle error codes from process_input_packet()

None are returned for now, but that will change in future commits.

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

 fftools/ffmpeg.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 68924d21e0..dd7cfcf632 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1103,6 +1103,8 @@ static int process_input(int file_index)
                 ret = process_input_packet(ist, NULL, 0);
                 if (ret>0)
                     return 0;
+                else if (ret < 0)
+                    return ret;
             }
 
             /* mark all outputs that don't go through lavfi as finished */
@@ -1124,11 +1126,11 @@ static int process_input(int file_index)
 
     sub2video_heartbeat(ifile, pkt->pts, pkt->time_base);
 
-    process_input_packet(ist, pkt, 0);
+    ret = process_input_packet(ist, pkt, 0);
 
     av_packet_free(&pkt);
 
-    return 0;
+    return ret < 0 ? ret : 0;
 }
 
 /**
@@ -1219,7 +1221,8 @@ static int transcode(int *err_rate_exceeded)
         float err_rate;
 
         if (!input_files[ist->file_index]->eof_reached) {
-            process_input_packet(ist, NULL, 0);
+            int err = process_input_packet(ist, NULL, 0);
+            ret = err_merge(ret, err);
         }
 
         err_rate = (ist->frames_decoded || ist->decode_errors) ?



More information about the ffmpeg-cvslog mailing list