Issue description
During RTMP stream playback with Exoplayer, when i switch the phone to airplane mode, exoplayer throws the following exception , the error handler block of exoplayer doesn't get called and the process dies.
E ExoPlayerImplInternal: Source error.
E ExoPlayerImplInternal: net.butterflytv.rtmp_client.RtmpClient$RtmpIOException
E ExoPlayerImplInternal: at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:55)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:141)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:702)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E ExoPlayerImplInternal: at java.lang.Thread.run(Thread.java:764)
F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc22e83b4 in tid 22827 (Loader:Extracto), pid 21732 ()
Reproduction steps
Just start playing any stream with exoplayer and then switch to airplane mode or close the network connection.
final BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
final TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
player = ExoPlayerFactory.newSimpleInstance(getContext(), trackSelector);
Surface videoSurface = new Surface(getSurfaceTexture());
player.setVideoSurface(videoSurface);
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(getContext(), "testapplication");
ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
MediaSource videoSource =
new ExtractorMediaSource(Uri.parse(getCurrentVideoUrl()),
dataSourceFactory,
extractorsFactory,
null,
null);
player.addListener(new PlayerEventHandler(this));
player.setRepeatMode(Player.REPEAT_MODE_ALL);
player.prepare(videoSource);
Link to test content
Version of ExoPlayer being used
Exoplayer 2.6.0 is used
//Exoplayer Support Added Here
implementation 'com.google.android.exoplayer:exoplayer:2.6.0'
//Support For Rtmp Streaming Added Here
implementation 'com.google.android.exoplayer:extension-rtmp:2.6.0'
Device(s) and version(s) of Android being used
NEXUS 5 7.0
GM5 Plus 7.0
Android Emulator Android 8.1.0
Android Emulator Android 8.0
A full bug report captured from the device
bugreport-sdk_gphone_x86-OPM1.171004.001-2017-12-16-00-05-18.zip
Relevant part of the bug report:
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: Source error.
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: net.butterflytv.rtmp_client.RtmpClient$RtmpIOException
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:55)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:141)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:702)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at java.lang.Thread.run(Thread.java:764)
12-16 00:04:59.322 10080 23330 29614 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc1feefb4 in tid 29614 (Loader:Extracto), pid 23330 (co.wormapp.worm)
12-16 00:04:59.342 10080 23330 23330 D wormlog : Player exception occurred:com.google.android.exoplayer2.ExoPlaybackException
12-16 00:04:59.342 10080 23330 23330 D wormlog : Player rtmp exception occurred:-3
12-16 00:04:59.342 10080 23330 23330 I ExoPlayerImpl: Release 1d5c0fe [ExoPlayerLib/2.6.0] [generic_x86, Android SDK built for x86, Google, 27] [goog.exo.core, goog.exo.rtmp]
12-16 00:04:59.338 10080 29670 29670 W crash_dump32: type=1400 audit(0.0:17): avc: denied { search } for name="uk.co.wormapp.worm" dev="dm-0" ino=115523 scontext=u:r:crash_dump:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
12-16 00:04:59.382 10080 29670 29670 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
12-16 00:04:59.382 1058 1511 1511 I /system/bin/tombstoned: received crash request for pid 23330
12-16 00:04:59.385 10080 29670 29670 I crash_dump32: performing dump of process 23330 (target tid = 29614)
12-16 00:04:59.385 10080 29670 29670 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-16 00:04:59.385 10080 29670 29670 F DEBUG : Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.1.0/OPM1.171004.001/4376136:user/release-keys'
12-16 00:04:59.385 10080 29670 29670 F DEBUG : Revision: '0'
12-16 00:04:59.385 10080 29670 29670 F DEBUG : ABI: 'x86'
12-16 00:04:59.385 10080 29670 29670 F DEBUG : pid: 23330, tid: 29614, name: Loader:Extracto >>> uk.co.wormapp.worm <<<
12-16 00:04:59.385 10080 29670 29670 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc1feefb4
12-16 00:04:59.385 10080 29670 29670 F DEBUG : eax 13805f60 ebx fff80000 ecx 8a180000 edx 00000063
12-16 00:04:59.385 10080 29670 29670 F DEBUG : esi ae7df79c edi 8a182444
12-16 00:04:59.385 10080 29670 29670 F DEBUG : xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
12-16 00:04:59.385 10080 29670 29670 F DEBUG : eip ae793921 ebp 8207f6c8 esp 8207f660 flags 00010a07
12-16 00:04:59.387 10080 29670 29670 F DEBUG :
12-16 00:04:59.387 10080 29670 29670 F DEBUG : backtrace:
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #00 pc 00093921 /system/lib/libc.so (arena_run_dalloc+113)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #1 pc 0008e500 /system/lib/libc.so (arena_dalloc_large_locked_impl+224)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #2 pc 0008e40b /system/lib/libc.so (je_arena_dalloc_large_junked_locked+43)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #3 pc 000b2cea /system/lib/libc.so (je_tcache_bin_flush_large+378)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #4 pc 000b3c0f /system/lib/libc.so (tcache_destroy+607)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #5 pc 000b3994 /system/lib/libc.so (je_tcache_cleanup+36)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #6 pc 000b4436 /system/lib/libc.so (je_tsd_cleanup+70)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #7 pc 000b54bc /system/lib/libc.so (je_tsd_cleanup_wrapper+44)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #8 pc 00071b84 /system/lib/libc.so (pthread_key_clean_all()+164)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #9 pc 000715d9 /system/lib/libc.so (pthread_exit+89)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #10 pc 0007144d /system/lib/libc.so (__pthread_start(void*)+61)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #11 pc 000205db /system/lib/libc.so (_start_thread+75)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #12 pc 0001ec16 /system/lib/libc.so (