This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit fcfb33922fb46e04418faadc08afaaf3d53bb145
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Fri Jan 30 15:02:33 2026 +0100
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Tue Feb 10 11:32:56 2026 +0100

    avformat/cafenc: don't keep track of nb packets ourselves
    
    Just reuse AVStream.nb_frames.
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavformat/cafenc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavformat/cafenc.c b/libavformat/cafenc.c
index f3f496a763..b7e7d1c56f 100644
--- a/libavformat/cafenc.c
+++ b/libavformat/cafenc.c
@@ -35,7 +35,6 @@
 typedef struct {
     int64_t data;
     int64_t total_duration;
-    int64_t packets;
     uint32_t frame_size;
 
     uint8_t *pakt_buf;
@@ -271,7 +270,6 @@ static int caf_write_packet(AVFormatContext *s, AVPacket 
*pkt)
             pakt_buf = put_variable_length_num(pakt_buf, pkt->duration);
         caf->pakt_buf_size = pakt_buf - caf->pakt_buf;
     }
-    caf->packets++;
     caf->total_duration += pkt->duration;
 
     avio_write(s->pb, pkt->data, pkt->size);
@@ -287,8 +285,8 @@ static int caf_write_trailer(AVFormatContext *s)
 
     if (pb->seekable & AVIO_SEEKABLE_NORMAL) {
         int64_t file_size = avio_tell(pb);
-        int64_t packets = (!par->block_align || !caf->frame_size) ? 
caf->packets : 0;
-        int64_t valid_frames = caf->frame_size ? caf->packets * 
caf->frame_size : caf->total_duration;
+        int64_t packets = (!par->block_align || !caf->frame_size) ? 
st->nb_frames : 0;
+        int64_t valid_frames = caf->frame_size ? st->nb_frames * 
caf->frame_size : caf->total_duration;
         unsigned remainder_frames = valid_frames > caf->total_duration
                                   ? valid_frames - caf->total_duration : 0;
 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to