Commit f32f5df4 by xiongziliang

修复mp4录制崩溃的bug:#181

parent 73df1bb9
...@@ -157,7 +157,7 @@ void MP4Muxer::addTrack(const Track::Ptr &track) { ...@@ -157,7 +157,7 @@ void MP4Muxer::addTrack(const Track::Ptr &track) {
return; return;
} }
struct mpeg4_avc_t avc; struct mpeg4_avc_t avc = {0};
string sps_pps = string("\x00\x00\x00\x01", 4) + h264_track->getSps() + string sps_pps = string("\x00\x00\x00\x01", 4) + h264_track->getSps() +
string("\x00\x00\x00\x01", 4) + h264_track->getPps(); string("\x00\x00\x00\x01", 4) + h264_track->getPps();
h264_annexbtomp4(&avc, sps_pps.data(), sps_pps.size(), NULL, 0, NULL, NULL); h264_annexbtomp4(&avc, sps_pps.data(), sps_pps.size(), NULL, 0, NULL, NULL);
...@@ -194,7 +194,7 @@ void MP4Muxer::addTrack(const Track::Ptr &track) { ...@@ -194,7 +194,7 @@ void MP4Muxer::addTrack(const Track::Ptr &track) {
return; return;
} }
struct mpeg4_hevc_t hevc; struct mpeg4_hevc_t hevc = {0};
string vps_sps_pps = string("\x00\x00\x00\x01", 4) + h265_track->getVps() + string vps_sps_pps = string("\x00\x00\x00\x01", 4) + h265_track->getVps() +
string("\x00\x00\x00\x01", 4) + h265_track->getSps() + string("\x00\x00\x00\x01", 4) + h265_track->getSps() +
string("\x00\x00\x00\x01", 4) + h265_track->getPps(); string("\x00\x00\x00\x01", 4) + h265_track->getPps();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论