[vlc-devel] [PATCH 2/2] According to the AVI-specs. the pixels are square. Therefore the aspect ratio should be set. Otherwise the aspect ratio of a previous video might be used.

VlcVelope 1034-135 at online.de
Fri Apr 27 19:09:42 CEST 2012


On 23.04.2012 23:48, VlcVelope wrote:
> On 22.04.2012 22:04, Laurent Aimar wrote:
>> On Sun, Apr 22, 2012 at 04:40:05PM +0200, VlcVelope wrote:
>>> ---
>>> modules/demux/avi/avi.c | 1 +
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
>>> index 08659d9..25a4d9c 100644
>>> --- a/modules/demux/avi/avi.c
>>> +++ b/modules/demux/avi/avi.c
>>> @@ -530,6 +530,7 @@ static int Open( vlc_object_t * p_this )
>>> fmt.video.i_bits_per_pixel = p_vids->p_bih->biBitCount;
>>> fmt.video.i_frame_rate = tk->i_rate;
>>> fmt.video.i_frame_rate_base = tk->i_scale;
>>> + fmt.video.i_sar_num = fmt.video.i_sar_den = 1;
>> Usually the AR in AVI comes from the ES stream. If you force the AR at
>> the demuxer level, it won't work anymore.
>> Also, the AR doesn't go across streams (at least it's the case in 2.0
>> and master).
>>
>> Regards,
>>
> You are probably right. But still why do some avi-files play with an
> incorrect AR (they do not with WMP and others). AFAIK avi files do not
> support setting an AR, so why should the fmt.video not be initialized
> with 1 right from the start or where would I find the correct position
> to initialize the correct AR? It seemed to work (at least up to now...)
>
> Thanks for the hint, though.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

You are definitely right: the problem was the AVI itself (it had a wrong 
AR in the stream, which is obviously ignored by WMP, and applying the 
right AR to the stream makes it play right.)

So my patch should be removed as it obviously overrides the AR coming 
from the stream... My fault.

Regards,
VlcVelope



More information about the vlc-devel mailing list