Commit aecd8612 authored by Rafaël Carré's avatar Rafaël Carré

avcodec: rate limit messages about direct rendering

parent 5e7c961f
...@@ -943,6 +943,7 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx, ...@@ -943,6 +943,7 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx,
AVFrame *frame, int flags) AVFrame *frame, int flags)
{ {
decoder_t *dec = (decoder_t *)ctx->opaque; decoder_t *dec = (decoder_t *)ctx->opaque;
decoder_sys_t *sys = dec->p_sys;
if (GetVlcChroma(&dec->fmt_out.video, ctx->pix_fmt) != VLC_SUCCESS) if (GetVlcChroma(&dec->fmt_out.video, ctx->pix_fmt) != VLC_SUCCESS)
return NULL; return NULL;
...@@ -963,6 +964,7 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx, ...@@ -963,6 +964,7 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx,
/* Check that the picture is suitable for libavcodec */ /* Check that the picture is suitable for libavcodec */
if (pic->p[0].i_pitch < width * pic->p[0].i_pixel_pitch) if (pic->p[0].i_pitch < width * pic->p[0].i_pixel_pitch)
{ {
if (sys->i_direct_rendering_used != 0)
msg_Dbg(dec, "plane 0: pitch too small (%d/%d*%d)", msg_Dbg(dec, "plane 0: pitch too small (%d/%d*%d)",
pic->p[0].i_pitch, width, pic->p[0].i_pixel_pitch); pic->p[0].i_pitch, width, pic->p[0].i_pixel_pitch);
goto no_dr; goto no_dr;
...@@ -970,6 +972,7 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx, ...@@ -970,6 +972,7 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx,
if (pic->p[0].i_lines < height) if (pic->p[0].i_lines < height)
{ {
if (sys->i_direct_rendering_used != 0)
msg_Dbg(dec, "plane 0: lines too few (%d/%d)", msg_Dbg(dec, "plane 0: lines too few (%d/%d)",
pic->p[0].i_lines, height); pic->p[0].i_lines, height);
goto no_dr; goto no_dr;
...@@ -979,12 +982,14 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx, ...@@ -979,12 +982,14 @@ static picture_t *lavc_dr_GetFrame(struct AVCodecContext *ctx,
{ {
if (pic->p[i].i_pitch % aligns[i]) if (pic->p[i].i_pitch % aligns[i])
{ {
if (sys->i_direct_rendering_used != 0)
msg_Dbg(dec, "plane %d: pitch not aligned (%d%%%d)", msg_Dbg(dec, "plane %d: pitch not aligned (%d%%%d)",
i, pic->p[i].i_pitch, aligns[i]); i, pic->p[i].i_pitch, aligns[i]);
goto no_dr; goto no_dr;
} }
if (((uintptr_t)pic->p[i].p_pixels) % aligns[i]) if (((uintptr_t)pic->p[i].p_pixels) % aligns[i])
{ {
if (sys->i_direct_rendering_used != 0)
msg_Warn(dec, "plane %d not aligned", i); msg_Warn(dec, "plane %d not aligned", i);
goto no_dr; goto no_dr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment