Skip to content

Commit

Permalink
meson-vdec: Return valid width/height in TRY_FMT
Browse files Browse the repository at this point in the history
When the driver is probed, before any H264 header has been passed,
TRY_FMT reset the width/height to 0. Application may be probing for
width/height acceptable range, which will result in a [0, 0], which
render the driver unusable generically.
  • Loading branch information
ndufresne committed Nov 5, 2015
1 parent 4dd9ab6 commit 2e86832
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/platform/meson/meson_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ static void configure_v4l2_plane_fmt(struct vdec_ctx *ctx,
struct buffer_size_info buf_info;

mp->pixelformat = ctx->fmt->pixelformat;
mp->width = ctx->frame_width;
mp->height = ctx->frame_height;
if (ctx->frame_width)
mp->width = ctx->frame_width;
if (ctx->frame_height)
mp->height = ctx->frame_height;
mp->field = V4L2_FIELD_NONE;

get_buffer_size_info(ctx->fmt, mp->width, mp->height, &buf_info);
Expand Down

0 comments on commit 2e86832

Please sign in to comment.