[Android] Save subtitles and playback speed only on exit
Geoffrey Métais
git at videolan.org
Thu Jun 23 12:48:17 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jun 23 12:40:37 2016 +0200| [883a92fb6d95863a7461d8c1f743e98f45fca26c] | committer: Geoffrey Métais
Save subtitles and playback speed only on exit
> https://code.videolan.org/videolan/vlc-android/commit/883a92fb6d95863a7461d8c1f743e98f45fca26c
---
.../vlc/gui/video/VideoPlayerActivity.java | 40 +++++++++++-----------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 8eeda99..d43f3ff 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -891,28 +891,28 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
}
}
- // Save selected subtitles
- String subtitleList_serialized = null;
- if(mSubtitleSelectedFiles.size() > 0) {
- Log.d(TAG, "Saving selected subtitle files");
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- try {
- ObjectOutputStream oos = new ObjectOutputStream(bos);
- oos.writeObject(mSubtitleSelectedFiles);
- subtitleList_serialized = bos.toString();
- } catch(IOException e) {}
- }
- editor.putString(PreferencesActivity.VIDEO_SUBTITLE_FILES, subtitleList_serialized);
-
- int ratePref = Integer.valueOf(mSettings.getString(PreferencesActivity.VIDEO_SAVE_SPEED, "0"));
- if (ratePref == 2)
- editor.putFloat(PreferencesActivity.VIDEO_RATE, mService.getRate());
- else if (ratePref == 0)
- mService.setRate(1.0f);
+ if (isFinishing()) {
+ // Save selected subtitles
+ String subtitleList_serialized = null;
+ if(mSubtitleSelectedFiles.size() > 0) {
+ Log.d(TAG, "Saving selected subtitle files");
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ try {
+ ObjectOutputStream oos = new ObjectOutputStream(bos);
+ oos.writeObject(mSubtitleSelectedFiles);
+ subtitleList_serialized = bos.toString();
+ } catch(IOException e) {}
+ }
+ editor.putString(PreferencesActivity.VIDEO_SUBTITLE_FILES, subtitleList_serialized);
- Util.commitPreferences(editor);
- if (isFinishing())
+ int ratePref = Integer.valueOf(mSettings.getString(PreferencesActivity.VIDEO_SAVE_SPEED, "0"));
+ if (ratePref == 2)
+ editor.putFloat(PreferencesActivity.VIDEO_RATE, mService.getRate());
+ else if (ratePref == 0)
+ mService.setRate(1.0f);
mService.stop();
+ }
+ Util.commitPreferences(editor);
}
private void cleanUI() {
More information about the Android
mailing list