From 23e99a7a77b19fa12251e35d4419d71886cee107 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 23 Apr 2020 12:00:15 +0200 Subject: [PATCH] codecs: set sys frame num before new_picture() Derive classes might need to operate on the current frame at their new_picture() vmethod, so it would be needed to set system_frame_number on picture before calling the vmethod. Part-of: --- gst-libs/gst/codecs/gsth264decoder.c | 4 ++-- gst-libs/gst/codecs/gsth265decoder.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/codecs/gsth264decoder.c b/gst-libs/gst/codecs/gsth264decoder.c index ee6bf71616..39eb17b19f 100644 --- a/gst-libs/gst/codecs/gsth264decoder.c +++ b/gst-libs/gst/codecs/gsth264decoder.c @@ -671,6 +671,8 @@ gst_h264_decoder_parse_slice (GstH264Decoder * self, GstH264NalUnit * nalu, picture = gst_h264_picture_new (); picture->pts = pts; + /* This allows accessing the frame from the picture. */ + picture->system_frame_number = priv->current_frame->system_frame_number; if (klass->new_picture) ret = klass->new_picture (self, picture); @@ -681,8 +683,6 @@ gst_h264_decoder_parse_slice (GstH264Decoder * self, GstH264NalUnit * nalu, return FALSE; } - /* This allows accessing the frame from the picture. */ - picture->system_frame_number = priv->current_frame->system_frame_number; priv->current_picture = picture; gst_video_codec_frame_set_user_data (priv->current_frame, gst_h264_picture_ref (priv->current_picture), diff --git a/gst-libs/gst/codecs/gsth265decoder.c b/gst-libs/gst/codecs/gsth265decoder.c index b06c8a1f1b..033d9f26b3 100644 --- a/gst-libs/gst/codecs/gsth265decoder.c +++ b/gst-libs/gst/codecs/gsth265decoder.c @@ -395,6 +395,8 @@ gst_h265_decoder_parse_slice (GstH265Decoder * self, GstH265NalUnit * nalu, picture = gst_h265_picture_new (); picture->pts = pts; + /* This allows accessing the frame from the picture. */ + picture->system_frame_number = priv->current_frame->system_frame_number; if (klass->new_picture) ret = klass->new_picture (self, picture); @@ -405,8 +407,6 @@ gst_h265_decoder_parse_slice (GstH265Decoder * self, GstH265NalUnit * nalu, return FALSE; } - /* This allows accessing the frame from the picture. */ - picture->system_frame_number = priv->current_frame->system_frame_number; priv->current_picture = picture; gst_video_codec_frame_set_user_data (priv->current_frame, gst_h265_picture_ref (priv->current_picture), -- 2.34.1