It is necessary to prefer the image in the packet to in_frame as it has been timestamped etc

This commit is contained in:
Isaac Connor 2021-01-29 15:37:51 -05:00
parent 292e1b4c9e
commit b812e0d484
1 changed files with 13 additions and 13 deletions

View File

@ -977,17 +977,7 @@ int VideoStore::writeVideoFramePacket(ZMPacket *zm_packet) {
return 0;
}
if ( !zm_packet->in_frame ) {
Debug(4, "Have no in_frame");
if ( zm_packet->packet.size ) {
Debug(4, "Decoding");
if ( !zm_packet->decode(video_in_ctx) ) {
Debug(2, "unable to decode yet.");
return 0;
}
// Go straight to out frame
swscale.Convert(zm_packet->in_frame, out_frame);
} else if ( zm_packet->image ) {
if ( zm_packet->image ) {
Debug(2, "Have an image, convert it");
//Go straight to out frame
swscale.Convert(
@ -999,6 +989,16 @@ int VideoStore::writeVideoFramePacket(ZMPacket *zm_packet) {
video_out_ctx->width,
video_out_ctx->height
);
} else if ( !zm_packet->in_frame ) {
Debug(4, "Have no in_frame");
if ( zm_packet->packet.size ) {
Debug(4, "Decoding");
if ( !zm_packet->decode(video_in_ctx) ) {
Debug(2, "unable to decode yet.");
return 0;
}
// Go straight to out frame
swscale.Convert(zm_packet->in_frame, out_frame);
} else {
Error("Have neither in_frame or image in packet %p %d!",