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

Git pushed a commit to branch master
in repository ffmpeg.

commit 72dac5d5c05f9f65d409a1b476055e327c25166e
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Wed Oct 28 06:01:51 2026 +0100
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Thu Oct 29 18:28:42 2026 +0000

    avformat/msf: compute the packet size in read_header
    
    The packet size was derived from the codecpar channel count on every
    read. For MP3, which is parsed, the channel count of the parser's codec
    context is copied back to codecpar, 0 when the decoder could not be
    opened, and the empty packets that followed never reached EOF, so
    seek_frame_generic() looped forever.
    
    Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavformat/msf.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavformat/msf.c b/libavformat/msf.c
index 37e05b538b..3a25ede752 100644
--- a/libavformat/msf.c
+++ b/libavformat/msf.c
@@ -24,6 +24,10 @@
 #include "demux.h"
 #include "internal.h"
 
+typedef struct MSFDemuxContext {
+    int packet_size;
+} MSFDemuxContext;
+
 static int msf_probe(const AVProbeData *p)
 {
     if (memcmp(p->buf, "MSF", 3))
@@ -43,6 +47,7 @@ static int msf_probe(const AVProbeData *p)
 
 static int msf_read_header(AVFormatContext *s)
 {
+    MSFDemuxContext *msf = s->priv_data;
     unsigned codec, size;
     AVStream *st;
     int ret;
@@ -90,6 +95,8 @@ static int msf_read_header(AVFormatContext *s)
             avpriv_request_sample(s, "Codec %d", codec);
             return AVERROR_PATCHWELCOME;
     }
+    msf->packet_size = st->codecpar->block_align ? st->codecpar->block_align
+                                                 : 1024 * 
st->codecpar->ch_layout.nb_channels;
     st->duration = av_get_audio_frame_duration2(st->codecpar, size);
     avio_skip(s->pb, 0x40 - avio_tell(s->pb));
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
@@ -99,15 +106,16 @@ static int msf_read_header(AVFormatContext *s)
 
 static int msf_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
-    AVCodecParameters *par = s->streams[0]->codecpar;
+    MSFDemuxContext *msf = s->priv_data;
 
-    return av_get_packet(s->pb, pkt, par->block_align ? par->block_align : 
1024 * par->ch_layout.nb_channels);
+    return av_get_packet(s->pb, pkt, msf->packet_size);
 }
 
 const FFInputFormat ff_msf_demuxer = {
     .p.name         = "msf",
     .p.long_name    = NULL_IF_CONFIG_SMALL("Sony PS3 MSF"),
     .p.extensions   = "msf",
+    .priv_data_size = sizeof(MSFDemuxContext),
     .read_probe     = msf_probe,
     .read_header    = msf_read_header,
     .read_packet    = msf_read_packet,

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to