Skip to content

Commit

Permalink
producer_avformat: Fix lowres if set too high
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjoppen committed May 15, 2024
1 parent 92840ba commit 5f22110
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/avformat/producer_avformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2281,6 +2281,13 @@ static int video_codec_init( producer_avformat self, int index, mlt_properties p
if ( thread_count >= 0 )
codec_context->thread_count = thread_count;

// fix lowres if set too high
int lowres = mlt_properties_get_int(properties, "lowres");
if (lowres > codec_context->codec->max_lowres) {
mlt_log_debug( MLT_PRODUCER_SERVICE( self->parent ), "clamping lowres=%i to max_lowres=%i\n", lowres, codec_context->codec->max_lowres );
mlt_properties_set_int(properties, "lowres", codec_context->codec->max_lowres);
}

#if USE_HWACCEL
if ( self->hwaccel.device_type == AV_HWDEVICE_TYPE_NONE || self->hwaccel.pix_fmt == AV_PIX_FMT_NONE )
{
Expand Down

0 comments on commit 5f22110

Please sign in to comment.