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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 300e0a8aea avcodec/vc1_parser: report no picture type until one has 
been read
300e0a8aea is described below

commit 300e0a8aeac5807a8cd49af458a25b2a0d72f45c
Author:     Vincent Herbst <[email protected]>
AuthorDate: Thu Sep 10 12:26:58 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sun Sep 20 12:14:04 2026 +0000

    avcodec/vc1_parser: report no picture type until one has been read
    
    av_parser_init() leaves pict_type at AV_PICTURE_TYPE_I, and this parser
    only sets it when it extracts a frame header. A track whose frames carry
    no start codes yields no header to it at all, so the default stands for
    the whole stream. ff_read_packet()'s parse path marks a packet a key
    frame when the parser reports AV_PICTURE_TYPE_I with key_frame unset, so
    every packet of such a track leaves the demuxer flagged as one.
    
    Matroska is the storage form this shows up in. Measured on
    samples.ffmpeg.org/V-codecs/WVC1/Test_1440x576_WVC1_6Mbps.wmv remuxed
    with -c copy: 1451 of 1451 packets flagged, against the ten the container
    carries and the ten -fflags +noparse reports. After the change the parsed
    count matches the container.
    
    Reporting AV_PICTURE_TYPE_NONE leaves the flag to the container, which is
    where it comes from for that storage form. A track this parser can read
    is unaffected, since it sets the picture type per frame: a raw .vc1
    stream, whose container carries no flags at all, still takes its single
    key frame from the parser.
    
    All nine vc1 FATE tests pass.
---
 libavcodec/vc1_parser.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vc1_parser.c b/libavcodec/vc1_parser.c
index 595d066dea..fa7e8120fd 100644
--- a/libavcodec/vc1_parser.c
+++ b/libavcodec/vc1_parser.c
@@ -261,6 +261,11 @@ static int vc1_parse(AVCodecParserContext *s,
 static av_cold int vc1_parse_init(AVCodecParserContext *s)
 {
     VC1ParseContext *vpc = s->priv_data;
+    /* Report no picture type until a frame header has actually been read.
+     * av_parser_init() leaves pict_type at AV_PICTURE_TYPE_I, and libavformat
+     * marks a packet a key frame from that default; a track whose frames carry
+     * no start codes yields no header to this parser at all. */
+    s->pict_type = AV_PICTURE_TYPE_NONE;
     vpc->v.s.slice_context_count = 1;
     vpc->v.first_pic_header_flag = 1;
     vpc->v.parse_only = 1;

-- 
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