RSATom / QmlVlc

[ABANDONED] libvlc wrapper for Qt Quick 2/Qml
Other
139 stars 56 forks source link

add mrl to playlist failed in c++ side. please see the error log. #15

Closed kingctan closed 10 years ago

kingctan commented 10 years ago
ived signal SIGSEGV, Segmentation fault.
__GI___pthread_mutex_lock (mutex=0x6c6d5158) at ../nptl/pthread_mutex_lock.c:66
66  ../nptl/pthread_mutex_lock.c: No such file or directory.
(gdb) bt
#0  __GI___pthread_mutex_lock (mutex=0x6c6d5158) at ../nptl/pthread_mutex_lock.c:66
#1  0xb659daf4 in pthread_mutex_lock (mutex=0x6c6d5158) at forward.c:192
#2  0x0806ce2f in __gthread_mutex_lock (__mutex=0x6c6d5158) at /usr/include/i386-linux-gnu/c++/4.8/bits/gthr-default.h:748
#3  0x0806ce85 in __gthread_recursive_mutex_lock (__mutex=0x6c6d5158) at /usr/include/i386-linux-gnu/c++/4.8/bits/gthr-default.h:810
#4  0x0806e2e3 in std::recursive_mutex::lock (this=0x6c6d5158) at /usr/include/c++/4.8/mutex:175
#5  0x0806efcf in std::lock_guard<std::recursive_mutex>::lock_guard (this=0xbfffe07c, __m=...) at /usr/include/c++/4.8/mutex:414
#6  0x0806e592 in vlc::lock_guard<std::recursive_mutex>::lock_guard (this=0xbfffe07c, m=...) at ../linuxktv/lib/QmlVlc/libvlc_wrapper/vlc_thread.h:52
#7  0x0806d5d8 in vlc::player::item_count (this=0x6c6d513c) at ../linuxktv/lib/QmlVlc/libvlc_wrapper/vlc_player.cpp:157
#8  0x08063bba in QmlVlcPlaylist::get_itemCount (this=0x85b7410) at ../linuxktv/lib/QmlVlc/QmlVlcPlaylist.cpp:9
#9  0x080956b1 in SongsQueue::play2play (this=0x85b6ac0) at ../linuxktv/songsqueue.h:472
#10 0x08092db0 in SongsQueue::qt_static_metacall (_o=0x85b6ac0, _c=QMetaObject::InvokeMetaMethod, _id=30, _a=0xbfffe2fc) at moc_songsqueue.cpp:264
#11 0x080931f4 in SongsQueue::qt_metacall (this=0x85b6ac0, _c=QMetaObject::InvokeMetaMethod, _id=30, _a=0xbfffe2fc) at moc_songsqueue.cpp:375
#12 0xb6a12d10 in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
#13 0xb7a1d3ce in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#14 0xb7a1ec10 in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#15 0xb7a1f322 in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#16 0xb79a575b in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#17 0xab335270 in ?? ()
#18 0xb79d7da7 in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#19 0xb7aefb6f in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#20 0xb7a87fc8 in QQmlBoundSignalExpression::evaluate(void**) () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#21 0xb7a88578 in ?? () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#22 0xb7acfb73 in QQmlNotifier::emitNotify(QQmlNotifierEndpoint*, void**) () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#23 0xb7a3e847 in QQmlData::signalEmitted(QAbstractDeclarativeData*, QObject*, int, void**) () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#24 0xb6a344d3 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
#25 0xb6a350eb in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQt5Core.so.5
#26 0xb7b6eedb in QQmlComponentAttached::completed() () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#27 0xb7a60eae in QQmlVME::complete(QQmlVME::Interrupt const&) () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#28 0xb7a55b4b in QQmlComponentPrivate::complete(QQmlEnginePrivate*, QQmlComponentPrivate::ConstructionState*) ()
   from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#29 0xb7a55c15 in QQmlComponentPrivate::completeCreate() () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#30 0xb7a55d5e in QQmlComponent::completeCreate() () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#31 0xb7a55a8f in QQmlComponent::create(QQmlContext*) () from /usr/lib/i386-linux-gnu/libQt5Qml.so.5
#32 0xb7e2a7ce in QQuickView::continueExecute() () from /usr/lib/i386-linux-gnu/libQt5Quick.so.5
#33 0xb7e2ada3 in ?? () from /usr/lib/i386-linux-gnu/libQt5Quick.so.5
#34 0x0807489a in QtQuick2ApplicationViewer::setMainQmlFile (this=0xbfffeed8, file=...)
    at ../linuxktv/qtquick2applicationviewer/qtquick2applicationviewer.cpp:71
#35 0x08075924 in main (argc=1, argv=0xbfffefb4) at ../linuxktv/main.cpp:300
RSATom commented 10 years ago

are you sure QmlVlcPlaylist instance is already correctly created when you call get_itemCount in SongsQueue::play2play ?

kingctan commented 10 years ago

if I need create QmlVlcPlaylist instance? I create player definded in QML and use

viewer.rootObject()->findChild<QObject*>("player");

to reference the player object,and then use the player's playlist object in c++. any problem if use like this.

RSATom commented 10 years ago

do you have public repo with your code?

kingctan commented 10 years ago

Sorry,no public repo.

RSATom commented 10 years ago

I think something wrong with your code, but can't tell what exactly without debugging.

RSATom commented 10 years ago

how do you call SongsQueue::play2play in qml? on which event?

kingctan commented 10 years ago

event: Component.onCompleted in the root Rectangle.

kingctan commented 10 years ago

I can't add mrl to the player's playerlist using javascript or in the c++ code. it will be crash when I add mrl.

RSATom commented 10 years ago

even without SongsQueue ?

RSATom commented 10 years ago

I think problem is SongsQueue tries to access to wrong, or not yet created object...

RSATom commented 10 years ago

Why not to try create property in SongsQueue of type VlcPlayer and assign it via QML? Then you will not need

viewer.rootObject()->findChild<QObject*>("player");

and it will be more safe

kingctan commented 10 years ago

you mean control the player just in QML? I use two player in one UI page. and want add a playlist(added by admin) to player1 when app start. then if anynone add the owner songs, my app should switch to another player2 to load the user's playlist and pause the player1.

RSATom commented 10 years ago

I mean something like

VlcPlayer {
    id: player;
}

SongsQueue {
   id: queue;
   linkedPlayer: player;
}

and then you will have no need to use

viewer.rootObject()->findChild<QObject*>("player");
RSATom commented 10 years ago

sorry, can't reproduce...