summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@ocrete.ca>2015-07-25 03:05:25 -0400
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2015-07-25 03:06:10 -0400
commit7afaf5c02050fcac18006abfdc01287f8dba16eb (patch)
treefe3f1b50c4f8443356850fca2d1e81b2300ef5e7
parentf92bf2618c84eed35204ee0a59bb3c5b6aa05f18 (diff)
avauddec: Access field using accessors
Those fields are documented to only be safe to access using accessors as their position is not part of the ABI.
-rw-r--r--ext/libav/gstavauddec.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c
index baca8fc..360d168 100644
--- a/ext/libav/gstavauddec.c
+++ b/ext/libav/gstavauddec.c
@@ -351,14 +351,15 @@ static gboolean
settings_changed (GstFFMpegAudDec * ffmpegdec, AVFrame * frame)
{
GstAudioFormat format;
- gint channels = av_get_channel_layout_nb_channels (frame->channel_layout);
+ gint channels =
+ av_get_channel_layout_nb_channels (av_frame_get_channel_layout (frame));
format = gst_ffmpeg_smpfmt_to_audioformat (frame->format);
if (format == GST_AUDIO_FORMAT_UNKNOWN)
return TRUE;
return !(ffmpegdec->info.rate ==
- frame->sample_rate &&
+ av_frame_get_sample_rate (frame) &&
ffmpegdec->info.channels == channels &&
ffmpegdec->info.finfo->format == format);
}
@@ -377,7 +378,8 @@ gst_ffmpegauddec_negotiate (GstFFMpegAudDec * ffmpegdec,
format = gst_ffmpeg_smpfmt_to_audioformat (frame->format);
if (format == GST_AUDIO_FORMAT_UNKNOWN)
goto no_caps;
- channels = av_get_channel_layout_nb_channels (frame->channel_layout);
+ channels =
+ av_get_channel_layout_nb_channels (av_frame_get_channel_layout (frame));
if (channels == 0)
goto no_caps;
@@ -387,9 +389,11 @@ gst_ffmpegauddec_negotiate (GstFFMpegAudDec * ffmpegdec,
GST_DEBUG_OBJECT (ffmpegdec,
"Renegotiating audio from %dHz@%dchannels (%d) to %dHz@%dchannels (%d)",
ffmpegdec->info.rate, ffmpegdec->info.channels,
- ffmpegdec->info.finfo->format, frame->sample_rate, channels, format);
+ ffmpegdec->info.finfo->format, av_frame_get_sample_rate (frame), channels,
+ format);
- gst_ffmpeg_channel_layout_to_gst (frame->channel_layout, channels, pos);
+ gst_ffmpeg_channel_layout_to_gst (av_frame_get_channel_layout (frame),
+ channels, pos);
memcpy (ffmpegdec->ffmpeg_layout, pos,
sizeof (GstAudioChannelPosition) * channels);
@@ -398,7 +402,7 @@ gst_ffmpegauddec_negotiate (GstFFMpegAudDec * ffmpegdec,
ffmpegdec->needs_reorder =
memcmp (pos, ffmpegdec->ffmpeg_layout, sizeof (pos[0]) * channels) != 0;
gst_audio_info_set_format (&ffmpegdec->info, format,
- frame->sample_rate, channels, pos);
+ av_frame_get_sample_rate (frame), channels, pos);
if (!gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (ffmpegdec),
&ffmpegdec->info))