mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
v4l2transform: fix scaling in case of fixed pixel aspect ratio
To change pixel aspect ratio from DAR to PAR, the necessary scaling factor is DAR/PAR, not DAR*PAR. For good measure, add debug output similar to the fixed-width and fixed-height cases. https://bugzilla.gnome.org/show_bug.cgi?id=766711
This commit is contained in:
parent
616ccbb0db
commit
89a2f0a647
1 changed files with 4 additions and 2 deletions
|
@ -687,9 +687,11 @@ gst_v4l2_transform_fixate_caps (GstBaseTransform * trans,
|
|||
to_par_n = gst_value_get_fraction_numerator (to_par);
|
||||
to_par_d = gst_value_get_fraction_denominator (to_par);
|
||||
|
||||
GST_DEBUG_OBJECT (trans, "PAR is fixed %d/%d", to_par_n, to_par_d);
|
||||
|
||||
/* Calculate scale factor for the PAR change */
|
||||
if (!gst_util_fraction_multiply (from_dar_n, from_dar_d, to_par_n,
|
||||
to_par_d, &num, &den)) {
|
||||
if (!gst_util_fraction_multiply (from_dar_n, from_dar_d, to_par_d,
|
||||
to_par_n, &num, &den)) {
|
||||
GST_ELEMENT_ERROR (trans, CORE, NEGOTIATION, (NULL),
|
||||
("Error calculating the output scaled size - integer overflow"));
|
||||
goto done;
|
||||
|
|
Loading…
Reference in a new issue