Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] lavc/hevc_ps: fix process failed when SPS before VPS in hvcC
@ 2022-09-09 13:09 1035567130
  2022-09-09 13:55 ` James Almer
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: 1035567130 @ 2022-09-09 13:09 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Wang Yaqiang

From: Wang Yaqiang <wangyaqiang03@kuaishou.com>

In some videos, SPS will be stored before VPS in hvcC box,
parse SPS does not depend on VPS, so the video is expected to be processed normally.
Added "parsed_vps" parameter to indicate whether VPS have been parsed.
Only VPS have been parsed can be verified during SPS parsing.

Signed-off-by: Wang Yaqiang <wangyaqiang03@kuaishou.com>
---
 libavcodec/hevc_ps.c | 4 ++--
 libavcodec/hevc_ps.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index f665d8053c..71835d0f36 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -464,7 +464,7 @@ int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx,
     if (!vps_buf)
         return AVERROR(ENOMEM);
     vps = (HEVCVPS*)vps_buf->data;
-
+    ps->parsed_vps = 1;
     av_log(avctx, AV_LOG_DEBUG, "Decoding VPS\n");
 
     nal_size = gb->buffer_end - gb->buffer;
@@ -1272,7 +1272,7 @@ int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx,
 
     ret = ff_hevc_parse_sps(sps, gb, &sps_id,
                             apply_defdispwin,
-                            ps->vps_list, avctx);
+                            ps->parsed_vps ? ps->vps_list : NULL, avctx);
     if (ret < 0) {
         av_buffer_unref(&sps_buf);
         return ret;
diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h
index 2a1bbf6489..e6b694e7f3 100644
--- a/libavcodec/hevc_ps.h
+++ b/libavcodec/hevc_ps.h
@@ -333,6 +333,7 @@ typedef struct HEVCParamSets {
     const HEVCVPS *vps;
     const HEVCSPS *sps;
     const HEVCPPS *pps;
+    int parsed_vps; // indicates VPS has been parsed
 } HEVCParamSets;
 
 /**
-- 
2.33.0

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

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-11-11  2:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-09 13:09 [FFmpeg-devel] [PATCH] lavc/hevc_ps: fix process failed when SPS before VPS in hvcC 1035567130
2022-09-09 13:55 ` James Almer
2022-09-09 14:34   ` wangyaqiang
2022-09-26  9:38 ` [FFmpeg-devel] [PATCH v2] " 1035567130
2022-09-26 20:21   ` Michael Niedermayer
2022-09-27 12:20     ` wangyaqiang
2022-10-14 10:13     ` wangyaqiang
2022-10-14 23:00       ` Michael Niedermayer
2022-10-25 14:29         ` wangyaqiang
2022-10-26  2:23 ` [FFmpeg-devel] [PATCH v3] " 1035567130
2022-11-11  2:25   ` wangyaqiang

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git