Changeset 21ca9ddb286c5c95059dbbcb9c24364e250a3d96
- Timestamp:
- 09/04/08 00:32:45
(6 months ago)
- Author:
- Filippo Carone <littlejohn@videolan.org>
- git-committer:
- Filippo Carone <littlejohn@videolan.org> 1207693965 +0200
- git-parent:
[fa096e6093bfa4e4e47cfec000e5e34944e2545e]
- git-author:
- Filippo Carone <littlejohn@videolan.org> 1207690962 +0200
- Message:
protect from null options param, and finalize added
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r88ff21f |
r21ca9dd |
|
| 31 | 31 | public class VLM |
|---|
| 32 | 32 | { |
|---|
| | 33 | |
|---|
| 33 | 34 | private JVLC jvlc; |
|---|
| | 35 | |
|---|
| | 36 | private volatile boolean released; |
|---|
| 34 | 37 | |
|---|
| 35 | 38 | public VLM(JVLC jvlc) |
|---|
| … | … | |
| 46 | 49 | input, |
|---|
| 47 | 50 | output, |
|---|
| 48 | | options.length, |
|---|
| | 51 | options == null ? 0 : options.length, |
|---|
| 49 | 52 | options, |
|---|
| 50 | 53 | enabled ? 1 : 0, |
|---|
| … | … | |
| 103 | 106 | input, |
|---|
| 104 | 107 | output, |
|---|
| 105 | | options.length, |
|---|
| | 108 | options == null ? 0 : options.length, |
|---|
| 106 | 109 | options, |
|---|
| 107 | 110 | enabled ? 1 : 0, |
|---|
| … | … | |
| 115 | 118 | jvlc.getLibvlc().libvlc_vlm_play_media(jvlc.getInstance(), name, exception); |
|---|
| 116 | 119 | } |
|---|
| 117 | | |
|---|
| | 120 | |
|---|
| 118 | 121 | public void stopMedia(String name) |
|---|
| 119 | 122 | { |
|---|
| … | … | |
| 121 | 124 | jvlc.getLibvlc().libvlc_vlm_stop_media(jvlc.getInstance(), name, exception); |
|---|
| 122 | 125 | } |
|---|
| 123 | | |
|---|
| | 126 | |
|---|
| 124 | 127 | public void pauseMedia(String name) |
|---|
| 125 | 128 | { |
|---|
| … | … | |
| 141 | 144 | |
|---|
| 142 | 145 | /** |
|---|
| 143 | | * |
|---|
| | 146 | * Releases native resources related to VLM. |
|---|
| 144 | 147 | */ |
|---|
| 145 | 148 | public void release() |
|---|
| 146 | 149 | { |
|---|
| | 150 | if (released) |
|---|
| | 151 | { |
|---|
| | 152 | return; |
|---|
| | 153 | } |
|---|
| | 154 | released = true; |
|---|
| 147 | 155 | libvlc_exception_t exception = new libvlc_exception_t(); |
|---|
| 148 | 156 | jvlc.getLibvlc().libvlc_vlm_release(jvlc.getInstance(), exception); |
|---|
| 149 | 157 | } |
|---|
| 150 | 158 | |
|---|
| | 159 | /** |
|---|
| | 160 | * {@inheritDoc} |
|---|
| | 161 | */ |
|---|
| | 162 | @Override |
|---|
| | 163 | protected void finalize() throws Throwable |
|---|
| | 164 | { |
|---|
| | 165 | release(); |
|---|
| | 166 | super.finalize(); |
|---|
| | 167 | } |
|---|
| 151 | 168 | |
|---|
| | 169 | |
|---|
| | 170 | |
|---|
| 152 | 171 | } |
|---|