]> git.sesse.net Git - nageru/blobdiff - nageru/ffmpeg_capture.cpp
Fix a bug where FFmpegCapture would get the wrong height, causing bogus scaling.
[nageru] / nageru / ffmpeg_capture.cpp
index a667d4f5b033aca8f5393d90f0f73bee31a87e4d..a8b6f612a06a470eb7427648497dffc4aaf47295 100644 (file)
@@ -895,6 +895,8 @@ AVFrameWithDeleter FFmpegCapture::decode_frame(AVFormatContext *format_ctx, AVCo
                                        *error = true;
                                        return AVFrameWithDeleter(nullptr);
                                }
+                               sw_frame->pts = video_avframe->pts;
+                               sw_frame->pkt_duration = video_avframe->pkt_duration;
                                video_avframe = move(sw_frame);
                        }
                        frame_finished = true;
@@ -1107,7 +1109,7 @@ unsigned FFmpegCapture::frame_height(const AVFrame *frame) const
        if (height == 0) {
                return frame->height;
        } else {
-               return width;
+               return height;
        }
 }