[FFmpeg-cvslog] fftools/ffmpeg: only set InputStream.next_pts for decoding

Anton Khirnov git at videolan.org
Thu Apr 13 16:42:39 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Mar 27 08:26:18 2023 +0200| [0feff04956992a535b6567a9395c8bf4083f1d5e] | committer: Anton Khirnov

fftools/ffmpeg: only set InputStream.next_pts for decoding

It is write-only for streamcopy.

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

 fftools/ffmpeg.c | 3 +--
 fftools/ffmpeg.h | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index f905836af6..4d4083d474 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1670,7 +1670,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
     if (pkt && pkt->dts != AV_NOPTS_VALUE) {
         ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, AV_TIME_BASE_Q);
         if (par->codec_type != AVMEDIA_TYPE_VIDEO || !ist->decoding_needed)
-            ist->next_pts = ist->pts = ist->dts;
+            ist->pts = ist->dts;
     }
 
     // while we have more to decode or while the decoder did output something on EOF
@@ -1811,7 +1811,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
             break;
         }
         ist->pts = ist->dts;
-        ist->next_pts = ist->next_dts;
     } else if (!ist->decoding_needed)
         eof_reached = 1;
 
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index aef2bbc0df..50e5858385 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -370,7 +370,8 @@ typedef struct InputStream {
     int64_t first_dts;       ///< dts of the first packet read for this stream (in AV_TIME_BASE units)
     int64_t       dts;       ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
 
-    int64_t       next_pts;  ///< synthetic pts for the next decode frame (in AV_TIME_BASE units)
+    /* predicted pts of the next decoded frame, in AV_TIME_BASE */
+    int64_t       next_pts;
     int64_t       pts;       ///< current pts of the decoded frame  (in AV_TIME_BASE units)
     int           wrap_correction_done;
 



More information about the ffmpeg-cvslog mailing list