How to avoid 15 second delay/caching in Android Media Player when playing stream

后端 未结 4 2236
迷失自我
迷失自我 2021-02-15 17:57

I am implementing a media player that plays a stream from a remote machine. Via my app I can control the remote machine (e.g. seek to second). Works like charm, but: The Android

4条回答
  •  独厮守ぢ
    2021-02-15 18:47

    Ok, meanwhile I got closer to the solution. Turned out the source of my problem is Android DRM! (No, I am not playing a protected file. Its standard mp3).

    DRM seems to have been introduced in Android 3.1 (I was testing on a Galaxy Tab 10.1). It works fine on the Emulator (maybe DRM is not implemented there?)

    Any idea how I can disable or accelerate this? There seems to be a 10 seconds timer somewhere deep in the Android DRM impl that waits for - whatever, no idea. My error log:

    10-06 17:38:19.020: ERROR/MediaExtractor(226): **********MediaExtractor::Create
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(226): add uniqueid
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 1
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :ADD_UNIQUEID
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 3
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :ADD_CLIENT
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(226): Entering BpDrmManagerService::openDecryptSession
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 27
    10-06 17:38:19.020: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :OPEN_DECRYPT_SESSION_FROM_URI
    10-06 17:38:19.020: ERROR/DrmManagerService(Native)(225): Entering DrmManagerService::openDecryptSession with uri
    
    10 seconds wait
    
    10-06 17:38:29.040: ERROR/DrmManager(Native)(225): DrmManager::openDecryptSession: no capable plug-in found
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): NULL decryptHandle is returned
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(226): no decryptHandle is generated in service side
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(226): remove uniqueid
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 2
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :REMOVE_UNIQUEID
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 4
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :REMOVE_CLIENT
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(226): setDrmServiceListener
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): Entering BnDrmManagerService::onTransact with code 5
    10-06 17:38:29.040: ERROR/IDrmManagerService(Native)(225): BnDrmManagerService::onTransact :SET_DRM_SERVICE_LISTENER
    10-06 17:38:29.040: ERROR/DrmManagerService(Native)(225): Entering setDrmServiceListener
    

提交回复
热议问题