libvlc 1.1.0 - changing aspect ratio not working

This forum is about all development around libVLC.
AEtH
Blank Cone
Blank Cone
Posts: 37
Joined: 23 Jun 2010 01:17

libvlc 1.1.0 - changing aspect ratio not working

Postby AEtH » 23 Jun 2010 20:37

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby Jean-Baptiste Kempf » 24 Jun 2010 09:15

POssibly. Provide a test application.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

AEtH
Blank Cone
Blank Cone
Posts: 37
Joined: 23 Jun 2010 01:17

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby AEtH » 24 Jun 2010 10:34

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.

DsChAeK
Blank Cone
Blank Cone
Posts: 59
Joined: 01 Mar 2008 14:54
VLC version: newest
Operating System: windows

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby DsChAeK » 24 Jun 2010 17:52

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.

AEtH
Blank Cone
Blank Cone
Posts: 37
Joined: 23 Jun 2010 01:17

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby AEtH » 26 Jun 2010 13:10

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

MidnightCoder
Blank Cone
Blank Cone
Posts: 82
Joined: 08 Aug 2008 06:04

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby MidnightCoder » 27 Jun 2010 08:13

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15148
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby Rémi Denis-Courmont » 27 Jun 2010 16:58

There is actually a bug where LibVLC video functions crash if called "early". This is fixed in LibVLC 1.1.1.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

AEtH
Blank Cone
Blank Cone
Posts: 37
Joined: 23 Jun 2010 01:17

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby AEtH » 28 Jun 2010 01:10

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15148
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby Rémi Denis-Courmont » 28 Jun 2010 01:44

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

AEtH
Blank Cone
Blank Cone
Posts: 37
Joined: 23 Jun 2010 01:17

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby AEtH » 28 Jun 2010 14:31

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby Jean-Baptiste Kempf » 28 Jun 2010 15:43

topic closed then.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Rémi Denis-Courmont
Developer
Developer
Posts: 15148
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc 1.1.0 - changing aspect ratio not working

Postby Rémi Denis-Courmont » 28 Jun 2010 15:52

Dereferencing NULL is a (cause of) segmentation fault.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests