Commit aa9bd56c by xiongziliang

回调可以设置空指针

parent 7272f01e
...@@ -178,7 +178,7 @@ API_EXPORT void API_CALL mk_player_seekto(mk_player ctx, float progress) { ...@@ -178,7 +178,7 @@ API_EXPORT void API_CALL mk_player_seekto(mk_player ctx, float progress) {
} }
static void mk_player_set_on_event(mk_player ctx, on_mk_play_event cb, void *user_data, int type) { static void mk_player_set_on_event(mk_player ctx, on_mk_play_event cb, void *user_data, int type) {
assert(ctx && cb); assert(ctx);
MediaPlayerForC &obj = **((MediaPlayerForC::Ptr *)ctx); MediaPlayerForC &obj = **((MediaPlayerForC::Ptr *)ctx);
obj.setOnEvent(cb,user_data, type); obj.setOnEvent(cb,user_data, type);
} }
...@@ -192,7 +192,7 @@ API_EXPORT void API_CALL mk_player_set_on_shutdown(mk_player ctx, on_mk_play_eve ...@@ -192,7 +192,7 @@ API_EXPORT void API_CALL mk_player_set_on_shutdown(mk_player ctx, on_mk_play_eve
} }
API_EXPORT void API_CALL mk_player_set_on_data(mk_player ctx, on_mk_play_data cb, void *user_data) { API_EXPORT void API_CALL mk_player_set_on_data(mk_player ctx, on_mk_play_data cb, void *user_data) {
assert(ctx && cb); assert(ctx);
MediaPlayerForC &obj = **((MediaPlayerForC::Ptr *)ctx); MediaPlayerForC &obj = **((MediaPlayerForC::Ptr *)ctx);
obj.setOnData(cb,user_data); obj.setOnData(cb,user_data);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论