Page 1 of 1

Autoscaling does not work with 4.0.0 if window handle was set

Posted: 10 Mar 2020 21:06
by filipp
And calling libvlc_video_set_scale just interrupts the program without any messages. In version 3 everything works correctly. Help, please, what am I doing wrong?

Code: Select all

int main(int argc, char *argv[]) { libvlc_instance_t* inst = libvlc_new(0, NULL); libvlc_media_t* m = libvlc_media_new_path(inst, "1.mp4"); libvlc_media_player_t* mp = libvlc_media_player_new_from_media(m); libvlc_media_release(m); libvlc_media_player_set_hwnd(mp, GetDesktopWindow()); // Desktop for example // libvlc_media_player_set_hwnd(mp, reinterpret_cast<unsigned __int64*>(ui.videoWidget->winId())); // Tried Qt widget libvlc_media_player_play(mp); Sleep(1000); libvlc_video_set_scale(mp, 2.0); // crash Sleep(10000); return 0; }
OS: Windows 10
Compiler: MSVC 2017
vout: direct3d11

Re: Autoscaling does not work with 4.0.0 if window handle was set

Posted: 10 Mar 2020 21:33
by Rémi Denis-Courmont
Hard to say without stack backtrace

Re: Autoscaling does not work with 4.0.0 if window handle was set

Posted: 11 Mar 2020 19:28
by filipp
Full code:

Code: Select all

#include <QApplication> #include <vlc/vlc.h> #include <QWidget> class MyWidget : public QWidget { libvlc_instance_t* inst; libvlc_media_player_t* mp; public: MyWidget() : QWidget() { inst = libvlc_new (0, NULL); libvlc_media_t* m = libvlc_media_new_path (inst, "q.mp4"); mp = libvlc_media_player_new_from_media(m); libvlc_media_release (m); void* drawable = reinterpret_cast<unsigned __int64*>(this->winId()); libvlc_media_player_set_hwnd (mp, drawable); libvlc_media_player_play (mp); } protected: void mouseDoubleClickEvent(QMouseEvent *) override { libvlc_video_set_scale(mp, 2.0); // <=========================== CRASH!!! } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget* widget = new MyWidget(); widget->show(); a.exec(); return 0; }
Call stack (gdb bt full) large enough:
https://gist.github.com/FilippVolodin/31890ba8eea29f5cedf6197cea32326c

Re: Autoscaling does not work with 4.0.0 if window handle was set

Posted: 12 Mar 2020 12:17
by Rémi Denis-Courmont
Seems like a regression in the VLC Windows windowing code.