[vlc-devel] [PATCH] [RFC] video_output: reinit the vout is the display area of pictures have changed

Steve Lhomme robux4 at gmail.com
Tue Dec 12 14:57:06 CET 2017


On Tue, Dec 12, 2017 at 2:51 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le 12 décembre 2017 15:13:18 GMT+02:00, Steve Lhomme <robux4 at videolabs.io> a écrit :
>>If you play a file that has the same decoder size but different display
>>size
>>consecutively, the decoder picture pool needs to be updated so that the
>>i_visible_lines of each picture plane matches the new picture format.
>>
>>The easiest way is to reinit the vout. Another way would be to update
>>the
>>pictures in each picture pool dynamically. It cannot just be handled on
>>the
>>vout side as some decoders and filters rely on i_visible/offset to copy
>>only the required data (for example lavc_CopyPicture).
>>
>>Fixes #19268
>>---
>> src/video_output/video_output.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>>diff --git a/src/video_output/video_output.c
>>b/src/video_output/video_output.c
>>index 0088ee9cca..6963c786ac 100644
>>--- a/src/video_output/video_output.c
>>+++ b/src/video_output/video_output.c
>>@@ -1546,7 +1546,8 @@ static int ThreadReinit(vout_thread_t *vout,
>>         return VLC_EGENERIC;
>>     }
>>/* We ignore crop/ar changes at this point, they are dynamically
>>supported */
>>-    VideoFormatCopyCropAr(&vout->p->original, &original);
>>+    vout->p->original.i_sar_num = original.i_sar_num;
>>+    vout->p->original.i_sar_den = original.i_sar_den;
>>     if (video_format_IsSimilar(&original, &vout->p->original)) {
>>         if (cfg->dpb_size <= vout->p->dpb_size) {
>>             video_format_Clean(&original);
>>--
>>2.14.2
>>
>>_______________________________________________
>>vlc-devel mailing list
>>To unsubscribe or modify your subscription options:
>>https://mailman.videolan.org/listinfo/vlc-devel
>
> I am not sure I understand the patch description.

s/is/if/ in the title

> And in any case, it does not seem to match the preexisting code comment.

Indeed. I forgot to comment on that.

Changing the aspect-ratio/crop values from the UI doesn't even reach
that code at all. This part of the code is really when the decoder
says the format has changed (which may still be crop changes...).

IMO it would be better to keep this code and update all the picture in
pools to update the visible dimensions for each of them. But that's an
uglier fix for 3.0.

> --
> Remi Denis-Courmont
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list