It is necessary to prefer the image in the packet to in_frame as it has been timestamped etc
This commit is contained in:
parent
292e1b4c9e
commit
b812e0d484
|
@ -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!",
|
||||
|
|
Loading…
Reference in New Issue