mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
videodecoder: Fix setting default pixel-aspect-ratio
It's needed to check if pixel-aspect-ratio exists before fixating. It does not exist if input caps is not set yet and allowed caps does not contain pixel-aspect-ratio (e.g. when using GST_VIDEO_CAPS_MAKE) https://bugzilla.gnome.org/show_bug.cgi?id=751932
This commit is contained in:
parent
002bdbf8a6
commit
008a228865
1 changed files with 7 additions and 2 deletions
|
@ -1097,9 +1097,14 @@ gst_video_decoder_negotiate_default_caps (GstVideoDecoder * decoder)
|
|||
/* Random 1280x720@30 for fixation */
|
||||
gst_structure_fixate_field_nearest_int (structure, "width", 1280);
|
||||
gst_structure_fixate_field_nearest_int (structure, "height", 720);
|
||||
gst_structure_fixate_field_nearest_fraction (structure,
|
||||
"pixel-aspect-ratio", 1, 1);
|
||||
gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1);
|
||||
if (gst_structure_has_field (structure, "pixel-aspect-ratio")) {
|
||||
gst_structure_fixate_field_nearest_fraction (structure,
|
||||
"pixel-aspect-ratio", 1, 1);
|
||||
} else {
|
||||
gst_structure_set (structure, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
||||
1, 1, NULL);
|
||||
}
|
||||
}
|
||||
caps = gst_caps_fixate (caps);
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
|
|
Loading…
Reference in a new issue