[FFmpeg-devel] [PATCH 1/4] mm: set audio pts proportionally to audio offset

Peter Ross pross at xvid.org
Sat Jun 8 12:03:20 EEST 2024


---
 libavformat/mm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mm.c b/libavformat/mm.c
index 23c025d852..a40b5c44bb 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -180,7 +180,8 @@ static int read_packet(AVFormatContext *s,
             if ((ret = av_get_packet(s->pb, pkt, length)) < 0)
                 return ret;
             pkt->stream_index = 1;
-            pkt->pts = mm->audio_pts++;
+            pkt->pts = mm->audio_pts;
+            mm->audio_pts += length;
             return 0;
 
         default :
-- 
2.43.0

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


More information about the ffmpeg-devel mailing list