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