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

This commit is contained in:
xiongziliang 2019-12-18 18:40:41 +08:00
parent 73df1bb949
commit f32f5df4eb

View File

@ -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) {
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();