From e9bf7e4b15460139c0474a97b9619c9e9fb3177f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 30 Jun 2019 18:17:23 -0700 Subject: Add an option to disable video in alffplay --- examples/alffplay.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples/alffplay.cpp') diff --git a/examples/alffplay.cpp b/examples/alffplay.cpp index 6298cb43..8016fd00 100644 --- a/examples/alffplay.cpp +++ b/examples/alffplay.cpp @@ -102,6 +102,7 @@ const std::string AppName{"alffplay"}; bool EnableDirectOut{false}; bool EnableWideStereo{false}; +bool DisableVideo{false}; LPALGETSOURCEI64VSOFT alGetSourcei64vSOFT; LPALCGETINTEGER64VSOFT alcGetInteger64vSOFT; @@ -1572,7 +1573,7 @@ int MovieState::parse_handler() for(unsigned int i = 0;i < mFormatCtx->nb_streams;i++) { auto codecpar = mFormatCtx->streams[i]->codecpar; - if(codecpar->codec_type == AVMEDIA_TYPE_VIDEO && video_index < 0) + if(codecpar->codec_type == AVMEDIA_TYPE_VIDEO && !DisableVideo && video_index < 0) video_index = streamComponentOpen(i); else if(codecpar->codec_type == AVMEDIA_TYPE_AUDIO && audio_index < 0) audio_index = streamComponentOpen(i); @@ -1859,6 +1860,8 @@ int main(int argc, char *argv[]) EnableWideStereo = true; } } + else if(strcmp(argv[fileidx], "-novideo") == 0) + DisableVideo = false; else break; } -- cgit v1.2.3