File tree Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Expand file tree Collapse file tree 1 file changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -144,18 +144,13 @@ NamesArray getVideoCodecsNames()
144
144
AVCodec* c = NULL ;
145
145
while ( ( c = av_codec_next ( c ) ) != NULL )
146
146
{
147
- switch ( c->type )
147
+ if ( c->type == AVMEDIA_TYPE_VIDEO )
148
148
{
149
- case AVMEDIA_TYPE_VIDEO:
150
- {
151
- if ( ! c->name && ! c->long_name )
152
- continue ;
149
+ if ( ! c->name && ! c->long_name )
150
+ continue ;
153
151
154
- videoCodecsNames.push_back ( std::make_pair ( std::string ( c->name ? c->name : " " ), std::string ( c->long_name ? c->long_name : " " ) ) );
155
- break ;
156
- }
157
- default :
158
- break ;
152
+ std::pair< std::string, std::string > codecNames ( std::string ( c->name ? c->name : " " ), std::string ( c->long_name ? c->long_name : " " ) );
153
+ videoCodecsNames.push_back ( codecNames );
159
154
}
160
155
}
161
156
return videoCodecsNames;
@@ -168,18 +163,13 @@ NamesArray getAudioCodecsNames()
168
163
AVCodec* c = NULL ;
169
164
while ( ( c = av_codec_next ( c ) ) != NULL )
170
165
{
171
- switch ( c->type )
166
+ if ( c->type == AVMEDIA_TYPE_AUDIO )
172
167
{
173
- case AVMEDIA_TYPE_AUDIO:
174
- {
175
- if ( ! c->name && ! c->long_name )
176
- continue ;
168
+ if ( ! c->name && ! c->long_name )
169
+ continue ;
177
170
178
- audioCodecsNames.push_back ( std::make_pair ( std::string ( c->name ? c->name : " " ), std::string ( c->long_name ? c->long_name : " " ) ) );
179
- break ;
180
- }
181
- default :
182
- break ;
171
+ std::pair< std::string, std::string > codecNames ( std::string ( c->name ? c->name : " " ), std::string ( c->long_name ? c->long_name : " " ) );
172
+ audioCodecsNames.push_back ( codecNames );
183
173
}
184
174
}
185
175
return audioCodecsNames;
You can’t perform that action at this time.
0 commit comments