Commit 1e09c7d7 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

ffmpeg: Move a few uses of codec to non-deprecated codecpar

It exists at least since 2014 (i got tired of digging backwards) so
we're safe
parent 6b06a88f
......@@ -167,9 +167,8 @@ bool K3bFFMpegFile::open()
return false;
}
d->isSpacious = ::av_sample_fmt_is_planar(FFMPEG_CODEC(d->audio_stream)->sample_fmt)
&& FFMPEG_CODEC(d->audio_stream)->channels > 1;
d->sampleFormat = FFMPEG_CODEC(d->audio_stream)->sample_fmt;
d->sampleFormat = d->audio_stream->codecpar->format;
d->isSpacious = ::av_sample_fmt_is_planar((AVSampleFormat)d->sampleFormat) && d->audio_stream->codecpar->channels > 1;
// dump some debugging info
::av_dump_format( d->formatContext, 0, m_filename.toLocal8Bit(), 0 );
......@@ -206,19 +205,19 @@ K3b::Msf K3bFFMpegFile::length() const
int K3bFFMpegFile::sampleRate() const
{
return FFMPEG_CODEC(d->audio_stream)->sample_rate;
return d->audio_stream->codecpar->sample_rate;
}
int K3bFFMpegFile::channels() const
{
return FFMPEG_CODEC(d->audio_stream)->channels;
return d->audio_stream->codecpar->channels;
}
int K3bFFMpegFile::type() const
{
return FFMPEG_CODEC(d->audio_stream)->codec_id;
return d->audio_stream->codecpar->codec_id;
}
......
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