vp8decoder: Fix resolution change handling
authorSeungha Yang <seungha@centricular.com>
Tue, 22 Oct 2024 14:41:13 +0000 (23:41 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 30 Oct 2024 01:16:58 +0000 (01:16 +0000)
Do not store resolution in set_format() so that resolution change
can be detected on keyframe as intended.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3928
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7787>

subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c

index eae9c12c8827a786104dd914513b6a7046b00a90..868042b8d3dc9c3b10a6b999446181c1596ed07f 100644 (file)
@@ -115,6 +115,9 @@ gst_vp8_decoder_start (GstVideoDecoder * decoder)
 
   gst_vp8_parser_init (&priv->parser);
   priv->wait_keyframe = TRUE;
+  priv->had_sequence = FALSE;
+  priv->width = 0;
+  priv->height = 0;
 
   priv->output_queue =
       gst_queue_array_new_for_struct (sizeof (GstVp8DecoderOutputFrame), 1);
@@ -217,9 +220,6 @@ gst_vp8_decoder_set_format (GstVideoDecoder * decoder,
 
   self->input_state = gst_video_codec_state_ref (state);
 
-  priv->width = GST_VIDEO_INFO_WIDTH (&state->info);
-  priv->height = GST_VIDEO_INFO_HEIGHT (&state->info);
-
   query = gst_query_new_latency ();
   if (gst_pad_peer_query (GST_VIDEO_DECODER_SINK_PAD (self), query))
     gst_query_parse_latency (query, &priv->is_live, NULL, NULL);