Android 内部存储的视频播放最终挂起/崩溃

发布于 2024-10-14 08:52:53 字数 5013 浏览 6 评论 0原文

我在播放 mp4 视频时遇到问题,其中涉及视频在播放过程中随机但一致的点冻结(随机是因为它似乎因设备而异,但一致是因为它似乎在给定的同一位置上设备)。相关视频从远程 URL 下载到设备并保存到内部设备存储中。由于本机 VideoView 类不支持从内部存储播放视频,因此我使用新方法创建了 VideoView 的修改版本,该方法接受指向相关视频文件的文件描述符。该类还被修改为将媒体播放器的数据源设置为此文件描述符。这会导致视频从内部设备存储中播放,尽管存在上述冻结问题。

从下面粘贴的 logcat 输出来看,媒体服务器崩溃似乎存在问题,可能涉及段错误。我在网上其他地方看到过类似崩溃的堆栈跟踪,但它们似乎与相机的使用有关,而不是与视频播放有关。我在三部不同的手机上对此进行了测试,其中两部运行 Android 2.2.1,第三部运行 Android 2.1。任何人都可以向我指出可能导致此问题的原因以及如何解决或规避它吗?

警告/InputManagerService(103): [ 01-25 14:55:48.791 9274:0x27db F/MPEG4Extractor ]
警告/InputManagerService(103):frameworks/base/media/libstagefright/MPEG4Extractor.cpp:1595 srcOffset + mNALLengthSize <= 大小
信息/调试(55):* ** * * * * ** * ** * ** **
信息/调试(55):构建指纹:'vodafone/vfpioneer/sapphire/sapphire:2.2.1/FRG83D/75603:user/release-keys'
信息/调试(55):pid:9274,tid:10203>>>> /system/bin/mediaserver <<<
INFO/DEBUG(55):信号 11 (SIGSEGV),故障地址 deadbaad
信息/调试(55): r0 00000000 r1 0000000c r2 00000027 r3 00000000
信息/调试(55):r4 00000000 r5 deadbaad r6 00001728 r7 fffde6df
信息/调试(55):r8 00100000 r9 a340a1f1 10 4050a000 fp 00016db8
信息/调试(55):ip ffffffff sp 40609908 lr afd154c5 pc afd11dc4 cpsr 40000030
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
...
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
信息/调试(55): #00 pc 00011dc4 /system/lib/libc.so
信息/调试(55): #01 pc 0000135c /system/lib/liblog.so
INFO/DEBUG(55):电脑周围的代码:
信息/调试(55):afd11da4 1c2bd00b 2d00682d e026d1fb 2b0068db
信息/调试(55):afd11db4 4e17d003 51a02001 4d164798 24002227
信息/调试(55):afd11dc4 f7fb702a 2106ee14 ef10f7fc 05592380
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
信息/调试(55): afd11dd4 6091aa01 1c116054 94012006 eab6f7fc
信息/调试(55):afd11de4 2200a905 f7fc2002 f7fbeac2 2106ee00
INFO/DEBUG(55):lr 周围的代码:
信息/调试(55):afd154a4 b0834a0d 589c447b 26009001 686768a5
信息/调试(55):afd154b4 220ce008 2b005eab 1c28d003 47889901
信息/调试(55):afd154c4 35544306 d5f43f01 2c006824 b003d1ee
信息/调试(55): afd154d4 bdf01c30 0002ae7c 000000d4 1c0fb5f0
信息/调试(55):afd154e4 43551c3d a904b087 1c16ac01 604d9004
信息/调试(55):堆栈:
信息/调试(55): 406098c8 00000000
信息/调试(55):406098cc 000003a0
信息/调试(55): 406098d0 afd40498 /system/lib/libc.so
信息/调试(55): 406098d4 afd41b6c /system/lib/libc.so
信息/调试(55): 406098d8 00000000
信息/调试(55): 406098dc afd154c5 /system/lib/libc.so
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
信息/调试(55): 406098e0 00000009
信息/调试(55): 406098e4 afd1450d /system/lib/libc.so
信息/调试(55): 406098e8 0000005f
信息/调试(55): 406098ec afd40328 /system/lib/libc.so
信息/调试(55): 406098f0 00000000
信息/调试(55): 406098f4 00001728
信息/调试(55): 406098f8 fffde6df
信息/调试(55): 406098fc afd147ab /system/lib/libc.so
信息/调试(55):40609900 df002777
信息/调试(55): 40609904 e3a070ad
信息/调试(55):#00 40609908 40609904
信息/调试(55): 4060990c 00000001
信息/调试(55): 40609910 a2f89987 /system/lib/libstagefright.so
信息/调试(55): 40609914 0000000f
信息/调试(55): 40609918 4060993c
信息/调试(55):4060991c fffffbdf
信息/调试(55): 40609920 4060993c
信息/调试(55): 40609924 a2f89987 /system/lib/libstagefright.so
信息/调试(55): 40609928 a2fab2a8 /system/lib/libstagefright.so
信息/调试(55): 4060992c afa0135f /system/lib/liblog.so
信息/调试(55):#01 40609930 4060993c
信息/调试(55): 40609934 afa0135f /system/lib/liblog.so
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
信息/调试(55): 40609938 40609d54
信息/调试(55):4060993c 6d617266
信息/调试(55): 40609940 726f7765
信息/调试(55): 40609944 622f736b
信息/调试(55): 40609948 2f657361
信息/调试(55):4060994c 6964656d
信息/调试(55): 40609950 696c2f61
信息/调试(55): 40609954 61747362
信息/调试(55): 40609958 72666567
信息/调试(55): 4060995c 74686769
信息/调试(55): 40609960 45504d2f
信息/调试(55): 40609964 78453447
信息/调试(55): 40609968 63617274
信息/调试(55):4060996c 2e726f74
信息/调试(55): 40609970 3a707063
信息/调试(55): 40609974 35393531
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
...
WARN/AACDecoder(9274):AAC 解码器返回错误 1,替换静音
INFO/ServiceManager(52):服务“media.audio_flinger”已死亡
INFO/ServiceManager(52):服务“media.player”死亡
INFO/ServiceManager(52):服务“media.camera”已死亡
INFO/ServiceManager(52):服务“media.audio_policy”已死亡
WARN/IMediaDeathNotifier(10181):媒体服务器死亡
错误/MediaPlayer(10181): 错误 (100, 0)
错误/MediaPlayer(10181):错误 (100,0)
调试/VideoView(10181):错误:100,0
WARN/AudioSystem(103): AudioFlinger 服务器死亡!
警告/音频系统(103):AudioPolicyService 服务器死亡!
INFO/BootReceiver(103):将 /data/tombstones/tombstone_03 复制到 DropBox (SYSTEM_TOMBSTONE)

I'm having an issue playing an mp4 video that involves the video freezing at a random but consistent point during playback (random in that it seems to differ from device to device, but consistent in that it seems to be the same place on a given device). The video in question is downloaded to the device from a remote url and saved to the internal device storage. Since the native VideoView class doesn't support video playback from the internal storage, I've created a modified version of VideoView with a new method that accepts a file descriptor pointing to the video file in question. The class has also been modified to set the media player's data source to this file descriptor. This results in the video being played from the internal device storage, albeit with the freezing issue described above.

Judging by the logcat output pasted below, there seems to be an issue with the mediaserver crashing, possibly involving a segfault. I've seen stack traces of similar crashes elsewhere on the 'net but they seem to be related to camera usage rather than video playback. I've tested this on three different handsets, two running Android 2.2.1 and the third running Android 2.1. Can anybody indicate to me what might be causing this issue and how I can fix or circumvent it?

WARN/InputManagerService(103): [ 01-25 14:55:48.791 9274:0x27db F/MPEG4Extractor ]
WARN/InputManagerService(103): frameworks/base/media/libstagefright/MPEG4Extractor.cpp:1595 srcOffset + mNALLengthSize <= size
INFO/DEBUG(55): * ** * ** * ** * ** * ** **
INFO/DEBUG(55): Build fingerprint: 'vodafone/vfpioneer/sapphire/sapphire:2.2.1/FRG83D/75603:user/release-keys'
INFO/DEBUG(55): pid: 9274, tid: 10203 >>> /system/bin/mediaserver <<<
INFO/DEBUG(55): signal 11 (SIGSEGV), fault addr deadbaad
INFO/DEBUG(55): r0 00000000 r1 0000000c r2 00000027 r3 00000000
INFO/DEBUG(55): r4 00000000 r5 deadbaad r6 00001728 r7 fffde6df
INFO/DEBUG(55): r8 00100000 r9 a340a1f1 10 4050a000 fp 00016db8
INFO/DEBUG(55): ip ffffffff sp 40609908 lr afd154c5 pc afd11dc4 cpsr 40000030
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
...
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
INFO/DEBUG(55): #00 pc 00011dc4 /system/lib/libc.so
INFO/DEBUG(55): #01 pc 0000135c /system/lib/liblog.so
INFO/DEBUG(55): code around pc:
INFO/DEBUG(55): afd11da4 1c2bd00b 2d00682d e026d1fb 2b0068db
INFO/DEBUG(55): afd11db4 4e17d003 51a02001 4d164798 24002227
INFO/DEBUG(55): afd11dc4 f7fb702a 2106ee14 ef10f7fc 05592380
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
INFO/DEBUG(55): afd11dd4 6091aa01 1c116054 94012006 eab6f7fc
INFO/DEBUG(55): afd11de4 2200a905 f7fc2002 f7fbeac2 2106ee00
INFO/DEBUG(55): code around lr:
INFO/DEBUG(55): afd154a4 b0834a0d 589c447b 26009001 686768a5
INFO/DEBUG(55): afd154b4 220ce008 2b005eab 1c28d003 47889901
INFO/DEBUG(55): afd154c4 35544306 d5f43f01 2c006824 b003d1ee
INFO/DEBUG(55): afd154d4 bdf01c30 0002ae7c 000000d4 1c0fb5f0
INFO/DEBUG(55): afd154e4 43551c3d a904b087 1c16ac01 604d9004
INFO/DEBUG(55): stack:
INFO/DEBUG(55): 406098c8 00000000
INFO/DEBUG(55): 406098cc 000003a0
INFO/DEBUG(55): 406098d0 afd40498 /system/lib/libc.so
INFO/DEBUG(55): 406098d4 afd41b6c /system/lib/libc.so
INFO/DEBUG(55): 406098d8 00000000
INFO/DEBUG(55): 406098dc afd154c5 /system/lib/libc.so
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
INFO/DEBUG(55): 406098e0 00000009
INFO/DEBUG(55): 406098e4 afd1450d /system/lib/libc.so
INFO/DEBUG(55): 406098e8 0000005f
INFO/DEBUG(55): 406098ec afd40328 /system/lib/libc.so
INFO/DEBUG(55): 406098f0 00000000
INFO/DEBUG(55): 406098f4 00001728
INFO/DEBUG(55): 406098f8 fffde6df
INFO/DEBUG(55): 406098fc afd147ab /system/lib/libc.so
INFO/DEBUG(55): 40609900 df002777
INFO/DEBUG(55): 40609904 e3a070ad
INFO/DEBUG(55): #00 40609908 40609904
INFO/DEBUG(55): 4060990c 00000001
INFO/DEBUG(55): 40609910 a2f89987 /system/lib/libstagefright.so
INFO/DEBUG(55): 40609914 0000000f
INFO/DEBUG(55): 40609918 4060993c
INFO/DEBUG(55): 4060991c fffffbdf
INFO/DEBUG(55): 40609920 4060993c
INFO/DEBUG(55): 40609924 a2f89987 /system/lib/libstagefright.so
INFO/DEBUG(55): 40609928 a2fab2a8 /system/lib/libstagefright.so
INFO/DEBUG(55): 4060992c afa0135f /system/lib/liblog.so
INFO/DEBUG(55): #01 40609930 4060993c
INFO/DEBUG(55): 40609934 afa0135f /system/lib/liblog.so
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
INFO/DEBUG(55): 40609938 40609d54
INFO/DEBUG(55): 4060993c 6d617266
INFO/DEBUG(55): 40609940 726f7765
INFO/DEBUG(55): 40609944 622f736b
INFO/DEBUG(55): 40609948 2f657361
INFO/DEBUG(55): 4060994c 6964656d
INFO/DEBUG(55): 40609950 696c2f61
INFO/DEBUG(55): 40609954 61747362
INFO/DEBUG(55): 40609958 72666567
INFO/DEBUG(55): 4060995c 74686769
INFO/DEBUG(55): 40609960 45504d2f
INFO/DEBUG(55): 40609964 78453447
INFO/DEBUG(55): 40609968 63617274
INFO/DEBUG(55): 4060996c 2e726f74
INFO/DEBUG(55): 40609970 3a707063
INFO/DEBUG(55): 40609974 35393531
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
...
WARN/AACDecoder(9274): AAC decoder returned error 1, substituting silence
INFO/ServiceManager(52): service 'media.audio_flinger' died
INFO/ServiceManager(52): service 'media.player' died
INFO/ServiceManager(52): service 'media.camera' died
INFO/ServiceManager(52): service 'media.audio_policy' died
WARN/IMediaDeathNotifier(10181): media server died
ERROR/MediaPlayer(10181): error (100, 0)
ERROR/MediaPlayer(10181): Error (100,0)
DEBUG/VideoView(10181): Error: 100,0
WARN/AudioSystem(103): AudioFlinger server died!
WARN/AudioSystem(103): AudioPolicyService server died!
INFO/BootReceiver(103): Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花落人断肠 2024-10-21 08:52:53

与此问题相关

原因与内存不足/audioflinger服务终止有关

It is related to this question

Causes are related to not enough memory/ audioflinger service dies

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文