refactor: check camera dimensions against the stream, not the decoder

The mismatch Debug compared the monitor's configured size against the decoder
context's. Both hold the same numbers -- the context is filled from the
stream's codecpar a few lines earlier -- but the stream is the thing actually
describing what the camera sends, and reading it here means the check no longer
needs a decoder to have been opened.

That matters for the next step: this was the camera's last use of the decoder
context for anything other than handing it out.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Y6FieTwEXuLhhR4e2yiax
This commit is contained in:
Isaac ConnorandClaude Opus 5 committed 2026-10-10 09:32:17 -04:00
1 parent ef629bdeaf
commit b2bbb2cbec
1 file changed
+7 -3
+7 -3
View File
@@ -653,13 +653,17 @@ int FfmpegCamera::OpenFfmpeg() {
}
} // end if have audio stream
// Ask the stream, not the decoder. Both carry the same dimensions -- the
// decoder context is filled from the stream's codecpar -- but the stream is
// what the camera is actually sending, and reading it here means this check
// does not depend on a decoder having been opened.
if (
((unsigned int)mVideoCodecContext->width != width)
((unsigned int)mVideoStream->codecpar->width != width)
||
((unsigned int)mVideoCodecContext->height != height)
((unsigned int)mVideoStream->codecpar->height != height)
) {
Debug(1, "Monitor dimensions are %dx%d but camera is sending %dx%d",
width, height, mVideoCodecContext->width, mVideoCodecContext->height);
width, height, mVideoStream->codecpar->width, mVideoStream->codecpar->height);
}
// Seed fallback per-frame durations (in each stream's time_base) used to space