Commit cfcca8a
Fix potential NPE in DefaultPlaybackSessionManager
When handling timeline updates or position discontinuities, we
may remove the current session and later attempt to access it
again if we haven't explicitly cleared the currentSessionId.
This could happen if this currentSessionId has not been marked
as isCreated. Part of this change guards against that gap by
more clearly clearing the currentSessionId in any case.
This whole situation shouldn't happen though because every
situation where we set the currentSessionId should also ensure
that this session is marked as isCreated. One way to reproduce
an issue is to generate data for a not-created placeholder session
and then making this session the current one by matching it
with an event for a different window index. This would hit one
of the early returns in updateSession before the session is
marked as isCreated. To prevent this root cause, we can make
sure to not match such sessions in belongsToSession.
Additionally, the check in updateSessions for the sequence number
should only be used if there actually is a sequence number
to check (a bug that got accidentally introduced by e0191dd)
Issue: #2885
PiperOrigin-RevId: 832263214
(cherry picked from commit 7784e73)1 parent 06e459e commit cfcca8a
File tree
3 files changed
+52
-10
lines changed- libraries/exoplayer/src
- main/java/androidx/media3/exoplayer/analytics
- test/java/androidx/media3/exoplayer/analytics
3 files changed
+52
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
187 | 191 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
209 | 214 | | |
210 | | - | |
211 | 215 | | |
212 | 216 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
281 | | - | |
| 282 | + | |
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
| |||
375 | 376 | | |
376 | 377 | | |
377 | 378 | | |
378 | | - | |
| 379 | + | |
379 | 380 | | |
380 | 381 | | |
381 | 382 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
970 | 1009 | | |
971 | 1010 | | |
972 | 1011 | | |
| |||
0 commit comments