Skip to content

Commit 17bfc7d

Browse files
author
Clement Champetier
committed
util: get formats without private context when getAvailableOptionsPerOutputFormat
1 parent 0d04bd9 commit 17bfc7d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/AvTranscoder/util.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,16 @@ OptionArrayMap getAvailableOptionsPerOutputFormat()
192192
// iterate on formats
193193
while(outputFormat)
194194
{
195-
// add only format with video track
196-
// outputFormat->audio_codec ?
197-
if(outputFormat->video_codec != AV_CODEC_ID_NONE)
195+
if(!outputFormat->name)
196+
continue;
197+
198+
const std::string outputFormatName(outputFormat->name);
199+
OptionArray options;
200+
if(outputFormat->priv_class)
198201
{
199-
if(outputFormat->priv_class)
200-
{
201-
const std::string outputFormatName(outputFormat->name);
202-
OptionArray options;
203-
loadOptions(options, (void*)&outputFormat->priv_class, 0);
204-
optionsPerFormat.insert(std::make_pair(outputFormatName, options));
205-
}
202+
loadOptions(options, (void*)&outputFormat->priv_class, 0);
206203
}
204+
optionsPerFormat.insert(std::make_pair(outputFormatName, options));
207205
outputFormat = av_oformat_next(outputFormat);
208206
}
209207
return optionsPerFormat;

0 commit comments

Comments
 (0)