populate mVideoStream and mAudioStream so we don't allocate new ones later

This commit is contained in:
Isaac Connor 2021-01-28 10:45:39 -05:00
parent 28d27cc30a
commit 335c1b1404
1 changed files with 2 additions and 0 deletions

View File

@ -316,6 +316,7 @@ int FfmpegCamera::OpenFfmpeg() {
if ( is_video_stream(stream) ) { if ( is_video_stream(stream) ) {
if ( mVideoStreamId == -1 ) { if ( mVideoStreamId == -1 ) {
mVideoStreamId = i; mVideoStreamId = i;
mVideoStream = mFormatContext->streams[i];
// if we break, then we won't find the audio stream // if we break, then we won't find the audio stream
continue; continue;
} else { } else {
@ -324,6 +325,7 @@ int FfmpegCamera::OpenFfmpeg() {
} else if ( is_audio_stream(stream) ) { } else if ( is_audio_stream(stream) ) {
if ( mAudioStreamId == -1 ) { if ( mAudioStreamId == -1 ) {
mAudioStreamId = i; mAudioStreamId = i;
mAudioStream = mFormatContext->streams[i];
} else { } else {
Debug(2, "Have another audio stream."); Debug(2, "Have another audio stream.");
} }