[vlc-devel] [PATCH] vout: we cannot reuse the decoder pool when the crop changes

Steve Lhomme robux4 at gmail.com
Thu Aug 18 16:26:30 CEST 2016


Patch replaced by https://patches.videolan.org/patch/14287/

On Thu, Aug 18, 2016 at 2:47 PM, Steve Lhomme <robux4 at gmail.com> wrote:
> On Thu, Aug 18, 2016 at 2:19 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
>> Le torstaina 18. elokuuta 2016, 12.40.41 EEST Steve Lhomme a écrit :
>>> If the crop values expand the pictures of the decoder pool would not be
>>> reallocated and keep an i_visible_lines that is not enough for the new crop
>>> area. Many filters will not copy more than the visible lines, starting with
>>> picture_Copy() used in ThreadDisplayRenderPicture().
>>
>> In principles, crop is applied after filters, precisely so we can change it
>> dynamically. Terminology is confusing here.
>
> Well, filters are supposed to handle at least the visible part of the
> picture (unless they do a crop or something like that). So they do
> have to know about it. In some case the i_visible_lines ends up
> mismatching the video_format_t of the picture and not all the visible
> area is used.
>
>>> Fixes #17602
>>
>> That bug report does not exist yet.
>
> That's #17062 although that issue is closed and handled. But there's
> mention of another bug when you play v1.avi and v2.avi (attached in
> that issue). v2.avi has the same decoded size as v1.avi but the
> visible area is bigger. That's because the decoder pool is not
> reinitialized on format change.
>
>>> ---
>>>  src/video_output/video_output.c | 13 +++++++++----
>>>  1 file changed, 9 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/src/video_output/video_output.c
>>> b/src/video_output/video_output.c index 7994bec..06fd0be 100644
>>> --- a/src/video_output/video_output.c
>>> +++ b/src/video_output/video_output.c
>>> @@ -94,12 +94,17 @@ static int VoutValidateFormat(video_format_t *dst,
>>>      video_format_FixRgb(dst);
>>>      return VLC_SUCCESS;
>>>  }
>>> +static void VideoFormatCopyAr(video_format_t *dst,
>>> +                              const video_format_t *src)
>>> +{
>>> +    dst->i_sar_num = src->i_sar_num;
>>> +    dst->i_sar_den = src->i_sar_den;
>>> +}
>>>  static void VideoFormatCopyCropAr(video_format_t *dst,
>>>                                    const video_format_t *src)
>>>  {
>>>      video_format_CopyCrop(dst, src);
>>> -    dst->i_sar_num = src->i_sar_num;
>>> -    dst->i_sar_den = src->i_sar_den;
>>> +    VideoFormatCopyAr(dst, src);
>>>  }
>>>  static bool VideoFormatIsCropArEqual(video_format_t *dst,
>>>                                       const video_format_t *src)
>>> @@ -1417,8 +1422,8 @@ static int ThreadReinit(vout_thread_t *vout,
>>>          ThreadClean(vout);
>>>          return VLC_EGENERIC;
>>>      }
>>> -    /* We ignore crop/ar changes at this point, they are dynamically
>>> supported */ -    VideoFormatCopyCropAr(&vout->p->original, &original);
>>> +    /* We ignore ar changes at this point, they are dynamically supported
>>> */ +    VideoFormatCopyAr(&vout->p->original, &original);
>>>      if (video_format_IsSimilar(&original, &vout->p->original)) {
>>>          if (cfg->dpb_size <= vout->p->dpb_size) {
>>>              video_format_Clean(&original);
>>
>>
>> --
>> Rémi Denis-Courmont
>> http://www.remlab.net/
>>
>> _______________________________________________
>> 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