Skip to content

Commit

Permalink
producer_avformat: Fix #985 lowres if set too high
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjoppen authored and ddennedy committed May 15, 2024
1 parent fb3f2a9 commit 296da35
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 @@ -2663,6 +2663,13 @@ static int video_codec_init(producer_avformat self, int index, mlt_properties pr
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 296da35

Please sign in to comment.