ffmpeg | branch: master | Gyan Doshi <ffm...@gyani.pro> | Mon Jul 19 13:12:55 
2021 +0530| [6f206852289ee8997bef6a43a88252834d2d3e02] | committer: Gyan Doshi

ffmpeg: delay readrate enforcement for decoded streams

Read rate enforcement delayed till first decoded frame is obtained, to
speed up init of output streams.

Thanks to Linjie Fu <linjie.justin...@gmail.com> for the initial patch.

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

 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 5678f6e7b9..a2dca146fe 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4237,7 +4237,7 @@ static int get_input_packet(InputFile *f, AVPacket **pkt)
         for (i = 0; i < f->nb_streams; i++) {
             InputStream *ist = input_streams[f->ist_index + i];
             int64_t stream_ts_offset, pts, now;
-            if (!ist->nb_packets) continue;
+            if (!ist->nb_packets || (ist->decoding_needed && 
!ist->got_output)) continue;
             stream_ts_offset = FFMAX(ist->first_dts != AV_NOPTS_VALUE ? 
ist->first_dts : 0, file_start);
             pts = av_rescale(ist->dts, 1000000, AV_TIME_BASE);
             now = (av_gettime_relative() - ist->start) * scale + 
stream_ts_offset;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to