| 1283 | } |
| 1284 | |
| 1285 | void ExportFFmpegOptions::DoOnCodecList() |
| 1286 | { |
| 1287 | wxString *selcdc = nullptr; |
| 1288 | wxString* selcdclong = nullptr; |
| 1289 | |
| 1290 | FindSelectedCodec(&selcdc, &selcdclong); |
| 1291 | |
| 1292 | if (selcdc == nullptr) |
| 1293 | { |
| 1294 | return; |
| 1295 | } |
| 1296 | |
| 1297 | wxString* selfmt = nullptr; |
| 1298 | wxString* selfmtlong = nullptr; |
| 1299 | |
| 1300 | FindSelectedFormat(&selfmt, &selfmtlong); |
| 1301 | |
| 1302 | auto cdc = mFFmpeg->CreateEncoder(selcdc->ToUTF8()); |
| 1303 | if (cdc == nullptr) |
| 1304 | { |
| 1305 | //This shouldn't really happen |
| 1306 | /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */ |
| 1307 | mCodecName->SetLabel(wxString(_("Failed to find the codec"))); |
| 1308 | return; |
| 1309 | } |
| 1310 | |
| 1311 | mCodecName->SetLabel(wxString::Format(wxT("[%d] %s"), (int) mFFmpeg->GetAudacityCodecID(cdc->GetId()).value, *selcdclong)); |
| 1312 | |
| 1313 | if (selfmt != nullptr) |
| 1314 | { |
| 1315 | auto fmt = mFFmpeg->GuessOutputFormat(selfmt->ToUTF8(), nullptr, nullptr); |
| 1316 | if (fmt == nullptr) |
| 1317 | { |
| 1318 | selfmt = nullptr; |
| 1319 | selfmtlong = nullptr; |
| 1320 | } |
| 1321 | } |
| 1322 | |
| 1323 | int newselfmt = FetchCompatibleFormatList( |
| 1324 | mFFmpeg->GetAudacityCodecID(cdc->GetId()), selfmt); |
| 1325 | |
| 1326 | if (newselfmt >= 0) |
| 1327 | mFormatList->Select(newselfmt); |
| 1328 | |
| 1329 | EnableDisableControls(cdc.get(), selfmt); |
| 1330 | Layout(); |
| 1331 | Fit(); |
| 1332 | return; |
| 1333 | } |
| 1334 | |
| 1335 | /// |
| 1336 | /// |
nothing calls this directly
no test coverage detected