Changeset aa61317790b9d8764d4881771626846dd011296a
- Timestamp:
- 03/03/07 23:26:18
(2 years ago)
- Author:
- Sigmund Augdal Helberg <sigmunau@videolan.org>
- git-committer:
- Sigmund Augdal Helberg <sigmunau@videolan.org> 1172960778 +0000
- git-parent:
[098b03f14ade630f4d2504554b8010f58d1bd8e2]
- git-author:
- Sigmund Augdal Helberg <sigmunau@videolan.org> 1172960778 +0000
- Message:
when a reference to a object is stored the ref-count of that module
should be increased. Fixes a few crashes when input changes.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rf56fb67 |
raa61317 |
|
| 47 | 47 | InputManager::~InputManager() |
|---|
| 48 | 48 | { |
|---|
| | 49 | delInput(); |
|---|
| 49 | 50 | } |
|---|
| 50 | 51 | |
|---|
| 51 | 52 | void InputManager::setInput( input_thread_t *_p_input ) |
|---|
| 52 | 53 | { |
|---|
| | 54 | delInput(); |
|---|
| 53 | 55 | p_input = _p_input; |
|---|
| 54 | 56 | emit positionUpdated( 0.0,0,0 ); |
|---|
| … | … | |
| 56 | 58 | if( p_input ) |
|---|
| 57 | 59 | { |
|---|
| | 60 | vlc_object_yield( p_input ); |
|---|
| 58 | 61 | vlc_value_t val; |
|---|
| 59 | 62 | var_Change( p_input, "video-es", VLC_VAR_CHOICESCOUNT, &val, NULL ); |
|---|
| … | … | |
| 64 | 67 | var_AddCallback( p_input, "video-es", ChangeVideo, this ); |
|---|
| 65 | 68 | } |
|---|
| 66 | | |
|---|
| 67 | | } |
|---|
| | 69 | } |
|---|
| | 70 | |
|---|
| 68 | 71 | void InputManager::delInput() |
|---|
| 69 | 72 | { |
|---|
| … | … | |
| 72 | 75 | var_DelCallback( p_input, "audio-es", ChangeAudio, this ); |
|---|
| 73 | 76 | var_DelCallback( p_input, "video-es", ChangeVideo, this ); |
|---|
| | 77 | vlc_object_release( p_input ); |
|---|
| | 78 | p_input = NULL; |
|---|
| 74 | 79 | } |
|---|
| 75 | 80 | } |
|---|
| … | … | |
| 86 | 91 | emit navigationChanged( 0 ); |
|---|
| 87 | 92 | emit statusChanged( 0 ); // 0 = STOPPED, 1 = PLAY, 2 = PAUSE |
|---|
| | 93 | delInput(); |
|---|
| | 94 | return; |
|---|
| 88 | 95 | } |
|---|
| 89 | 96 | |
|---|