Buggy code:
public class SmoothStreamingRendererBuilder implements RendererBuilder , ManifestCallback < SmoothStreamingManifest > { private static final int BUFFER_SEGMENT_SIZE = 64 * 1024 ; private static final int VIDEO_BUFFER_SEGMENTS = 200 ; private static final int AUDIO_BUFFER_SEGMENTS = 60 ; private static final int TTML_BUFFER_SEGMENTS = 2 ; private final String userAgent ; private final String url ; private final String contentId ; private final MediaDrmCallback drmCallback ; private final TextView debugTextView ; private DemoPlayer player ; private RendererBuilderCallback callback ; public SmoothStreamingRendererBuilder ( String userAgent , String url , String contentId , MediaDrmCallback drmCallback , TextView debugTextView ) { } @ Override public void buildRenderers ( DemoPlayer player , RendererBuilderCallback callback ) { } @ Override public void onManifestError ( String contentId , Exception e ) { } @ Override public void onManifest ( String contentId , SmoothStreamingManifest manifest ) { Handler mainHandler = player . getMainHandler ( ) ; LoadControl loadControl = new com . google . android . exoplayer . DefaultLoadControl ( new BufferPool ( SmoothStreamingRendererBuilder . BUFFER_SEGMENT_SIZE ) ) ; DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter ( mainHandler , player ) ; DrmSessionManager drmSessionManager = null ; if ( ( manifest . protectionElement ) != null ) { if ( ( Util . SDK_INT ) < 18 ) { callback . onRenderersError ( new UnsupportedOperationException ( ( "Protected<seq2seq4repair_space>content<seq2seq4repair_space>not<seq2seq4repair_space>supported<seq2seq4repair_space>on<seq2seq4repair_space>API<seq2seq4repair_space>level<seq2seq4repair_space>" + ( Util . SDK_INT ) ) ) ) ; return ; } try { drmSessionManager = SmoothStreamingRendererBuilder . V18Compat . getDrmSessionManager ( manifest . protectionElement . uuid , player , drmCallback ) ; <START_BUG> } catch ( UnsupportedSchemeException e ) { <END_BUG> callback . onRenderersError ( e ) ; return ; } } int maxDecodableFrameSize = MediaCodecUtil . maxH264DecodableFrameSize ( ) ; int audioStreamElementCount = 0 ; int textStreamElementCount = 0 ; int videoStreamElementIndex = - 1 ; ArrayList < Integer > videoTrackIndexList = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < ( manifest . streamElements . length ) ; i ++ ) { if ( ( manifest . streamElements [ i ] . type ) == ( StreamElement . TYPE_AUDIO ) ) { audioStreamElementCount ++ ; } else if ( ( manifest . streamElements [ i ] . type ) == ( StreamElement . TYPE_TEXT ) ) { textStreamElementCount ++ ; } else if ( ( videoStreamElementIndex == ( - 1 ) ) && ( ( manifest . streamElements [ i ] . type ) == ( StreamElement . TYPE_VIDEO ) ) ) { videoStreamElementIndex = i ; StreamElement streamElement = manifest . streamElements [ i ] ; for ( int j = 0 ; j < ( streamElement . tracks . length ) ; j ++ ) { TrackElement trackElement = streamElement . tracks [ j ] ; if ( ( ( trackElement . maxWidth ) * ( trackElement . maxHeight ) ) <= maxDecodableFrameSize ) { videoTrackIndexList . add ( j ) ; } else { } } } } int [ ] videoTrackIndices = new int [ videoTrackIndexList . size ( ) ] ; for ( int i = 0 ; i < ( videoTrackIndexList . size ( ) ) ; i ++ ) { videoTrackIndices [ i ] = videoTrackIndexList . get ( i ) ; } DataSource videoDataSource = new HttpDataSource ( userAgent , HttpDataSource . REJECT_PAYWALL_TYPES , bandwidthMeter ) ; ChunkSource videoChunkSource = new com . google . android . exoplayer . smoothstreaming . SmoothStreamingChunkSource ( url , manifest , videoStreamElementIndex , videoTrackIndices , videoDataSource , new com . google . android . exoplayer . chunk . FormatEvaluator . AdaptiveEvaluator ( bandwidthMeter ) ) ; ChunkSampleSource videoSampleSource = new ChunkSampleSource ( videoChunkSource , loadControl , ( ( SmoothStreamingRendererBuilder . VIDEO_BUFFER_SEGMENTS ) * ( SmoothStreamingRendererBuilder . BUFFER_SEGMENT_SIZE ) ) , true , mainHandler , player , DemoPlayer . TYPE_VIDEO ) ; MediaCodecVideoTrackRenderer videoRenderer = new MediaCodecVideoTrackRenderer ( videoSampleSource , drmSessionManager , true , MediaCodec . VIDEO_SCALING_MODE_SCALE_TO_FIT , 5000 , mainHandler , player , 50 ) ; final String [ ] audioTrackNames ; final MultiTrackChunkSource audioChunkSource ; final MediaCodecAudioTrackRenderer audioRenderer ; if ( audioStreamElementCount == 0 ) { audioTrackNames = null ; audioChunkSource = null ; audioRenderer = null ; } else { audioTrackNames = new String [ audioStreamElementCount ] ; ChunkSource [ ] audioChunkSources = new ChunkSource [ audioStreamElementCount ] ; DataSource audioDataSource = new HttpDataSource ( userAgent , HttpDataSource . REJECT_PAYWALL_TYPES , bandwidthMeter ) ; FormatEvaluator audioFormatEvaluator = new FormatEvaluator . FixedEvaluator ( ) ; audioStreamElementCount = 0 ; for ( int i = 0 ; i < ( manifest . streamElements . length ) ; i ++ ) { if ( ( manifest . streamElements [ i ] . type ) == ( StreamElement . TYPE_AUDIO ) ) { audioTrackNames [ audioStreamElementCount ] = manifest . streamElements [ i ] . name ; audioChunkSources [ audioStreamElementCount ] = new com . google . android . exoplayer . smoothstreaming . SmoothStreamingChunkSource ( url , manifest , i , new int [ ] { 0 } , audioDataSource , audioFormatEvaluator ) ; audioStreamElementCount ++ ; } } audioChunkSource = new MultiTrackChunkSource ( audioChunkSources ) ; ChunkSampleSource audioSampleSource = new ChunkSampleSource ( audioChunkSource , loadControl , ( ( SmoothStreamingRendererBuilder . AUDIO_BUFFER_SEGMENTS ) * ( SmoothStreamingRendererBuilder . BUFFER_SEGMENT_SIZE ) ) , true , mainHandler , player , DemoPlayer . TYPE_AUDIO ) ; audioRenderer = new MediaCodecAudioTrackRenderer ( audioSampleSource , drmSessionManager , true , mainHandler , player ) ; } final String [ ] textTrackNames ; final MultiTrackChunkSource textChunkSource ; final TrackRenderer textRenderer ; if ( textStreamElementCount == 0 ) { textTrackNames = null ; textChunkSource = null ; textRenderer = null ; } else { textTrackNames = new String [ textStreamElementCount ] ; ChunkSource [ ] textChunkSources = new ChunkSource [ textStreamElementCount ] ; DataSource ttmlDataSource = new HttpDataSource ( userAgent , HttpDataSource . REJECT_PAYWALL_TYPES , bandwidthMeter ) ; FormatEvaluator ttmlFormatEvaluator = new FormatEvaluator . FixedEvaluator ( ) ; textStreamElementCount = 0 ; for ( int i = 0 ;

Fix:
} catch ( Exception e ) {