Skip to content

Commit

Permalink
tidy: Fixes for "assignment in if statement" warnings. (indentation)
Browse files Browse the repository at this point in the history
The previous commit didn't change the code indentation to minimize the
size of the change, and to highlight the actual changes.  This commit
only changes the indentation.
  • Loading branch information
linuxdude42 committed Mar 26, 2024
1 parent d6c026c commit d04cc8a
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
Expand Up @@ -5253,47 +5253,44 @@ bool AvFormatDecoder::SetupAudioStream(void)
return false;
}

{
AudioFormat fmt =
AudioOutputSettings::AVSampleFormatToFormat(ctx->sample_fmt,
ctx->bits_per_raw_sample);

if (av_sample_fmt_is_planar(ctx->sample_fmt))
{
LOG(VB_AUDIO, LOG_INFO, LOC + QString("Audio data is planar"));
}
AudioFormat fmt =
AudioOutputSettings::AVSampleFormatToFormat(ctx->sample_fmt,
ctx->bits_per_raw_sample);

if (fmt == FORMAT_NONE)
{
int bps = av_get_bytes_per_sample(ctx->sample_fmt) << 3;
if (ctx->sample_fmt == AV_SAMPLE_FMT_S32 &&
ctx->bits_per_raw_sample)
bps = ctx->bits_per_raw_sample;
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Unsupported sample format with %1 bits").arg(bps));
return false;
}
if (av_sample_fmt_is_planar(ctx->sample_fmt))
{
LOG(VB_AUDIO, LOG_INFO, LOC + QString("Audio data is planar"));
}

bool using_passthru = DoPassThrough(curstream->codecpar, false);
if (fmt == FORMAT_NONE)
{
int bps = av_get_bytes_per_sample(ctx->sample_fmt) << 3;
if (ctx->sample_fmt == AV_SAMPLE_FMT_S32 &&
ctx->bits_per_raw_sample)
bps = ctx->bits_per_raw_sample;
LOG(VB_GENERAL, LOG_ERR, LOC +
QString("Unsupported sample format with %1 bits").arg(bps));
return false;
}

requested_channels = ctx->ch_layout.nb_channels;
bool using_passthru = DoPassThrough(curstream->codecpar, false);

if (!using_passthru &&
ctx->ch_layout.nb_channels > (int)m_audio->GetMaxChannels() &&
DecoderWillDownmix(ctx))
{
requested_channels = m_audio->GetMaxChannels();
requested_channels = ctx->ch_layout.nb_channels;

AVChannelLayout channel_layout;
av_channel_layout_default(&channel_layout, requested_channels);
av_opt_set_chlayout(ctx->priv_data, "downmix", &channel_layout, 0);
}
if (!using_passthru &&
ctx->ch_layout.nb_channels > (int)m_audio->GetMaxChannels() &&
DecoderWillDownmix(ctx))
{
requested_channels = m_audio->GetMaxChannels();

info = AudioInfo(ctx->codec_id, fmt, ctx->sample_rate,
requested_channels, using_passthru, ctx->ch_layout.nb_channels,
ctx->codec_id == AV_CODEC_ID_DTS ? ctx->profile : 0);
AVChannelLayout channel_layout;
av_channel_layout_default(&channel_layout, requested_channels);
av_opt_set_chlayout(ctx->priv_data, "downmix", &channel_layout, 0);
}

info = AudioInfo(ctx->codec_id, fmt, ctx->sample_rate,
requested_channels, using_passthru, ctx->ch_layout.nb_channels,
ctx->codec_id == AV_CODEC_ID_DTS ? ctx->profile : 0);
if (info == m_audioIn)
return false;

Expand Down

0 comments on commit d04cc8a

Please sign in to comment.