Page 1 of 1

libvlc 1.1.0 - changing aspect ratio not working

Posted: 23 Jun 2010 20:37
by AEtH
Hi everyone, I just found that passing the option

--aspect-ratio=width:height

to libvlc_new() is not working anymore. With 1.0.6 works well, even if you add the command-line option to vlc.exe ir works, but not as a parameter of libvlc_new().

Any ideas? A bug?

Thanks.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 24 Jun 2010 09:15
by Jean-Baptiste Kempf
POssibly. Provide a test application.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 24 Jun 2010 10:34
by AEtH
The code involving the instance creation is here (delphi):

Code: Select all

var Args: array [0..2] of PChar begin args[0]:=pchar('--no-video-title-show'); args[1]:=pchar('--no-audio'); args[2]:=pchar('--aspect-ratio=16:10'); VLC := libvlc_new(3, @Args);
Also, I can post an example app if it's ok, written in delphi.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 24 Jun 2010 17:52
by DsChAeK
You could add this option with libvlc_media_add_option() or libvlc_video_set_aspect_ratio(), no need to add this on libvlc_new() I think.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 26 Jun 2010 13:10
by AEtH
I tried to do that, but setting the aspect ratio with libvlc_media_add_option gives the same result (nothing).

On the other hand, calling libvlc_video_set_aspect_ratio keeps throwing an exeception when I call it. However, if I handhe the exception everything works fine, which is awkward.

This is how I use libvlc_video_set_aspect_ratio:

Code: Select all

libvlc_video_set_aspect_ratio:procedure(mediaplayer: libvlc_media_player;aspect:PChar); cdecl; //Using the function: libvlc_video_set_aspect_ratio(player,pchar('16:9'))
Thanks

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 27 Jun 2010 08:13
by MidnightCoder
libvlc_video_set_aspect_ratio is the right method and it's working fine in v1.1.0. Perhaps you didn't marshall the argument over correctly? I'm not familiar with the language you are using but I can confirm this method works as expected in v1.1.0 under Windows.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 27 Jun 2010 16:58
by Rémi Denis-Courmont
There is actually a bug where LibVLC video functions crash if called "early". This is fixed in LibVLC 1.1.1.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 28 Jun 2010 01:10
by AEtH
This may be the problem I have. I can solve the situation by handling the exception (and the function works fine), but is strange. I'll be waiting for the next release.

Thanks

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 28 Jun 2010 01:44
by Rémi Denis-Courmont
Handling the exception? It is a segmentation fault, you cannot recover safely from that, other than by terminating the process. Your VM is rather dreadful if it allows you to catch such an exception.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 28 Jun 2010 14:31
by AEtH
I was not having a segmentation fault, just reading adress #00000000. As you can see, I'm talking in past, with the yesterday build of 1.1.1, the problem has been solved, now libvlc_video_set_aspect_ratio works fine.

I still haven't tested adding the argument with 1.1.1, using that API call solved my problem.

Thanks to everyone.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 28 Jun 2010 15:43
by Jean-Baptiste Kempf
topic closed then.

Re: libvlc 1.1.0 - changing aspect ratio not working

Posted: 28 Jun 2010 15:52
by Rémi Denis-Courmont
Dereferencing NULL is a (cause of) segmentation fault.