<html><head></head><body>Hi,<br><br>I don't think we should override previous user settings, in this case A/R. Though there is indeed a bug in the current code.<br><br>Also, AFAICT, the source update should occur before prep'ing a picture, not when updating the decoder output format. That's probably why the buggy code was left as it is.<br><br><div class="gmail_quote">Le 19 juin 2019 08:09:43 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">In push we still need to clean the format every time the source changes. Before<br>it was done before the display pool was allocated and kept all along.<hr> src/video_output/display.c | 22 ++++++++++++++++------<br> src/video_output/display.h | 1 +<br> src/video_output/video_output.c | 7 +------<br> 3 files changed, 18 insertions(+), 12 deletions(-)<br><br>diff --git a/src/video_output/display.c b/src/video_output/display.c<br>index f295ad6731..2173bb084e 100644<br>--- a/src/video_output/display.c<br>+++ b/src/video_output/display.c<br>@@ -588,18 +588,28 @@ static int vout_SetSourceAspect(vout_display_t *vd,<br> return ret;<br> }<br> <br>+void VoutFixFormatAR(video_format_t *fmt)<br>+{<br>+ vlc_ureduce( &fmt->i_sar_num, &fmt->i_sar_den,<br>+ fmt->i_sar_num, fmt->i_sar_den, 50000 );<br>+ if (fmt->i_sar_num <= 0 || fmt->i_sar_den <= 0) {<br>+ fmt->i_sar_num = 1;<br>+ fmt->i_sar_den = 1;<br>+ }<br>+}<br>+<br> void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t *source)<br> {<br> vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);<br> int err1 = 0, err2 = 0;<br> <br>- if (source->i_sar_num * osys->source.i_sar_den !=<br>- source->i_sar_den * osys->source.i_sar_num) {<br>+ video_format_t fixed_src = *source;<br>+ VoutFixFormatAR( &fixed_src );<br>+ if (fixed_src.i_sar_num * osys->source.i_sar_den !=<br>+ fixed_src.i_sar_den * osys->source.i_sar_num) {<br> <br>- osys->source.i_sar_num = source->i_sar_num;<br>- osys->source.i_sar_den = source->i_sar_den;<br>- vlc_ureduce(&osys->source.i_sar_num, &osys->source.i_sar_den,<br>- osys->source.i_sar_num, osys->source.i_sar_den, 0);<br>+ osys->source.i_sar_num = fixed_src.i_sar_num;<br>+ osys->source.i_sar_den = fixed_src.i_sar_den;<br> <br> /* FIXME it will override any AR that the user would have forced */<br> err1 = vout_SetSourceAspect(vd, osys->source.i_sar_num,<br>diff --git a/src/video_output/display.h b/src/video_output/display.h<br>index f9100d98ef..35138c5c70 100644<br>--- a/src/video_output/display.h<br>+++ b/src/video_output/display.h<br>@@ -23,3 +23,4 @@<br> #include "vout_wrapper.h"<br> <br> void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t *);<br>+void VoutFixFormatAR(video_format_t *);<br>diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c<br>index 1ae84bbb1c..a3ef144da1 100644<br>--- a/src/video_output/video_output.c<br>+++ b/src/video_output/video_output.c<br>@@ -87,12 +87,7 @@ static void VoutFixFormat(video_format_t *dst, const video_format_t *src)<br> {<br> video_format_Copy(dst, src);<br> dst->i_chroma = vlc_fourcc_GetCodec(VIDEO_ES, src->i_chroma);<br>- vlc_ureduce( &dst->i_sar_num, &dst->i_sar_den,<br>- src->i_sar_num, src->i_sar_den, 50000 );<br>- if (dst->i_sar_num <= 0 || dst->i_sar_den <= 0) {<br>- dst->i_sar_num = 1;<br>- dst->i_sar_den = 1;<br>- }<br>+ VoutFixFormatAR( dst );<br> video_format_FixRgb(dst);<br> }<br> </pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>