mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 02:34:26 +08:00
修复mk_media_source_get_track接口崩溃问题:#2552
This commit is contained in:
parent
23e24d07e6
commit
72ba87c803
@ -98,7 +98,7 @@ API_EXPORT int API_CALL mk_media_source_get_reader_count(const mk_media_source c
|
|||||||
API_EXPORT int API_CALL mk_media_source_get_total_reader_count(const mk_media_source ctx);
|
API_EXPORT int API_CALL mk_media_source_get_total_reader_count(const mk_media_source ctx);
|
||||||
// get track count from MediaSource
|
// get track count from MediaSource
|
||||||
API_EXPORT int API_CALL mk_media_source_get_track_count(const mk_media_source ctx);
|
API_EXPORT int API_CALL mk_media_source_get_track_count(const mk_media_source ctx);
|
||||||
// get track by index from MediaSource
|
// copy track reference by index from MediaSource, please use mk_track_unref to release it
|
||||||
API_EXPORT mk_track API_CALL mk_media_source_get_track(const mk_media_source ctx, int index);
|
API_EXPORT mk_track API_CALL mk_media_source_get_track(const mk_media_source ctx, int index);
|
||||||
/**
|
/**
|
||||||
* 直播源在ZLMediaKit中被称作为MediaSource,
|
* 直播源在ZLMediaKit中被称作为MediaSource,
|
||||||
|
@ -211,7 +211,7 @@ API_EXPORT mk_track API_CALL mk_media_source_get_track(const mk_media_source ctx
|
|||||||
if (index < 0 && index >= tracks.size()) {
|
if (index < 0 && index >= tracks.size()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return reinterpret_cast<mk_track>(& (tracks[index]));
|
return (mk_track) new Track::Ptr(std::move(tracks[index]));
|
||||||
}
|
}
|
||||||
|
|
||||||
API_EXPORT int API_CALL mk_media_source_close(const mk_media_source ctx,int force){
|
API_EXPORT int API_CALL mk_media_source_close(const mk_media_source ctx,int force){
|
||||||
|
Loading…
Reference in New Issue
Block a user