Fix FFmpeg frame generator ending.

This commit is contained in:
John Preston 2022-09-08 09:50:11 +04:00
parent b0203af398
commit ab25cf214c

View file

@ -343,10 +343,10 @@ void FrameGenerator::Impl::readNextFrame() {
return;
}
} while (packet.fields().stream_index != _streamId);
if (finished) {
continue;
}
if (finished) {
result = avcodec_send_packet(_codec.get(), nullptr); // Drain.
} else {
const auto native = &packet.fields();
const auto guard = gsl::finally([
&,
@ -357,8 +357,8 @@ void FrameGenerator::Impl::readNextFrame() {
native->data = data;
packet = Packet();
});
result = avcodec_send_packet(_codec.get(), native);
}
if (result < 0) {
LOG(("Webm Error: Unable to avcodec_send_packet(), ")
+ wrapError(result));