libVLC: Video has incorrect forced aspect ratio when starting playback.
LibVLC instance renders the video using incorrect aspect ratio, when the aspect ratio and size is forced in startup parameters. The libvlc_video_set_aspect_ratio method call is not effective unless the video is playing. The problem occurs also in the VLC player when having multiple files with different aspect ratios
Prerequisites:
Two video files with different aspect ratio e.g.
Video1: 16:9 and
Video2: 4:3
Steps to reproduce:
- Start VLC using command line: vlc --aspect-ratio="16:9" --width="455" --height="256"
Outcome: Aspect ratio is forced to 16:9, but it is also the native aspect ratio so video1 plays correctly. OK!
- Pause the playback and open in the same VLC instance. File->Open
Outcome: Video2 Starts playing at video2's native aspect ratio 4:3, not the forced 16:9. Expected the video to be stretched to 16:9 fit the screen.
Additional Info:
If you check the menu: Video->Aspect Ratio The "16:9" is selected.
This problem also occurs when using the libVLC from an application. The method call libvlc_video_set_aspect_ratio sets the aspect ratio to internal variable but actually it does not affect on the rendering. However the libvlc_video_set_aspect_ratio is called during the rendering it works correctly.
So libVLC should refresh the selected aspect ratio in the beginning of each video file.