Commit 4736bb9b authored by Philippe Gorley's avatar Philippe Gorley

encoder: fix flushing

Change-Id: I6cd7e28ed62581c5635a32966b46171441de42c2
parent 0f6ffcac
......@@ -466,9 +466,7 @@ MediaEncoder::encodeAudio(AudioFrame& frame)
MediaEncoder::encode(AVFrame* frame, int streamIdx)
if (not frame)
return -1;
if (!initialized_) {
if (!initialized_ && frame) {
// Initialize on first video frame, or first audio frame if no video stream
bool isVideo = (frame->width > 0 && frame->height > 0);
if (isVideo or not videoOpts_.isValid()) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment