Skip to content
Snippets Groups Projects
Commit 821ec73a authored by Adrien Béraud's avatar Adrien Béraud
Browse files

accel: don't try to transfer null frame

Change-Id: Ia9cf5638678c0e92127ec9bf3631235a2827d49d
parent dfa51993
No related branches found
No related tags found
No related merge requests found
......@@ -374,6 +374,8 @@ std::unique_ptr<VideoFrame>
HardwareAccel::transferToMainMemory(const VideoFrame& frame, AVPixelFormat desiredFormat)
{
auto input = frame.pointer();
if (not input)
throw std::runtime_error("Cannot transfer null frame");
auto out = std::make_unique<VideoFrame>();
auto desc = av_pix_fmt_desc_get(static_cast<AVPixelFormat>(input->format));
......
......@@ -231,11 +231,11 @@ VideoMixer::update(Observable<std::shared_ptr<MediaFrame>>* ob,
std::shared_ptr<VideoFrame> frame;
try {
frame = HardwareAccel::transferToMainMemory(*std::static_pointer_cast<VideoFrame>(frame_p), AV_PIX_FMT_NV12);
x->atomic_copy(*std::static_pointer_cast<VideoFrame>(frame));
} catch (const std::runtime_error& e) {
JAMI_ERR("Accel failure: %s", e.what());
return;
}
x->atomic_copy(*std::static_pointer_cast<VideoFrame>(frame));
#else
x->atomic_copy(*std::static_pointer_cast<VideoFrame>(frame_p));
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment