return set_opt(o.name, o.value);\r
});\r
\r
- if(vcodec == CODEC_ID_NONE)\r
+ if(vcodec == CODEC_ID_NONE && format)\r
vcodec = format->video_codec;\r
\r
- if(acodec == CODEC_ID_NONE)\r
+ if(acodec == CODEC_ID_NONE && format)\r
acodec = format->audio_codec;\r
\r
if(vcodec == CODEC_ID_NONE)\r
{\r
auto str = std::accumulate(params.begin(), params.end(), std::wstring(), [](const std::wstring& lhs, const std::wstring& rhs) {return lhs + L" " + rhs;});\r
\r
- boost::wregex path_exp(L"(FILE)? (?<PATH>.+\\..+).*", boost::regex::icase);\r
+ boost::wregex path_exp(L"\\s*FILE(\\s(?<PATH>.+\\.[^\\s]+))?.*", boost::regex::icase);\r
\r
boost::wsmatch path;\r
if(!boost::regex_match(str, path, path_exp))\r