mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
avcodecmap: Only append values to the video/audio format lists if we don't have them already
This commit is contained in:
parent
3c77754524
commit
3e154333de
1 changed files with 8 additions and 2 deletions
|
@ -191,7 +191,10 @@ gst_ffmpeg_video_set_pix_fmts (GstCaps * caps, const enum AVPixelFormat *fmts)
|
|||
format = gst_ffmpeg_pixfmt_to_videoformat (*fmts);
|
||||
if (format != GST_VIDEO_FORMAT_UNKNOWN) {
|
||||
g_value_set_string (&v, gst_video_format_to_string (format));
|
||||
gst_value_list_append_value (&va, &v);
|
||||
/* Only append values we don't have yet */
|
||||
if (gst_value_list_get_size (&va) == 0
|
||||
|| !gst_value_can_intersect (&v, &va))
|
||||
gst_value_list_append_value (&va, &v);
|
||||
}
|
||||
fmts++;
|
||||
}
|
||||
|
@ -452,7 +455,10 @@ gst_ffmpeg_audio_set_sample_fmts (GstCaps * caps,
|
|||
format = gst_ffmpeg_smpfmt_to_audioformat (*fmts);
|
||||
if (format != GST_AUDIO_FORMAT_UNKNOWN) {
|
||||
g_value_set_string (&v, gst_audio_format_to_string (format));
|
||||
gst_value_list_append_value (&va, &v);
|
||||
/* Only append values we don't have yet */
|
||||
if (gst_value_list_get_size (&va) == 0
|
||||
|| !gst_value_can_intersect (&v, &va))
|
||||
gst_value_list_append_value (&va, &v);
|
||||
}
|
||||
fmts++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue