From ab8e895b12f054da643ecde5d5716ec45200eca0 Mon Sep 17 00:00:00 2001 From: James Park Date: Sun, 19 May 2019 21:27:18 -0700 Subject: [PATCH] libobs: Remove unreachable YUV decode paths A previous refactoring to make DrawMatrix unnecessary has left behind unreachable YUV conversions. Even if this code was somehow reachable, DrawMatrix for YUV -> RGB doesn't exist anymore, so they would render incorrectly anyway. --- libobs/obs-source.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 65bc89dc8..aa3f26b33 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -1668,8 +1668,6 @@ bool update_async_texture(struct obs_source *source, gs_texture_t *tex, gs_texrender_t *texrender) { enum convert_type type; - uint8_t *ptr; - uint32_t linesize; source->async_flip = frame->flip; @@ -1683,29 +1681,7 @@ bool update_async_texture(struct obs_source *source, return true; } - if (!gs_texture_map(tex, &ptr, &linesize)) - return false; - - if (type == CONVERT_420) - decompress_420((const uint8_t* const*)frame->data, - frame->linesize, - 0, frame->height, ptr, linesize); - - else if (type == CONVERT_NV12) - decompress_nv12((const uint8_t* const*)frame->data, - frame->linesize, - 0, frame->height, ptr, linesize); - - else if (type == CONVERT_422_Y) - decompress_422(frame->data[0], frame->linesize[0], - 0, frame->height, ptr, linesize, true); - - else if (type == CONVERT_422_U) - decompress_422(frame->data[0], frame->linesize[0], - 0, frame->height, ptr, linesize, false); - - gs_texture_unmap(tex); - return true; + return false; } static inline void obs_source_draw_texture(struct obs_source *source,