File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ extern "C" {
7
7
}
8
8
9
9
#include < utility>
10
+ #include < algorithm>
10
11
11
12
namespace avtranscoder
12
13
{
@@ -150,6 +151,11 @@ NamesArray getVideoCodecsNames()
150
151
continue ;
151
152
152
153
std::pair< std::string, std::string > codecNames ( std::string ( c->name ? c->name : " " ), std::string ( c->long_name ? c->long_name : " " ) );
154
+
155
+ // skip duplicates
156
+ if ( std::find ( videoCodecsNames.begin (), videoCodecsNames.end (), codecNames ) != videoCodecsNames.end () )
157
+ continue ;
158
+
153
159
videoCodecsNames.push_back ( codecNames );
154
160
}
155
161
}
@@ -169,6 +175,11 @@ NamesArray getAudioCodecsNames()
169
175
continue ;
170
176
171
177
std::pair< std::string, std::string > codecNames ( std::string ( c->name ? c->name : " " ), std::string ( c->long_name ? c->long_name : " " ) );
178
+
179
+ // skip duplicates
180
+ if ( std::find ( audioCodecsNames.begin (), audioCodecsNames.end (), codecNames ) != audioCodecsNames.end () )
181
+ continue ;
182
+
172
183
audioCodecsNames.push_back ( codecNames );
173
184
}
174
185
}
You can’t perform that action at this time.
0 commit comments