aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-30 18:17:23 -0700
committerChris Robinson <[email protected]>2019-06-30 18:17:23 -0700
commite9bf7e4b15460139c0474a97b9619c9e9fb3177f (patch)
tree014b29c6d516fb2e9c48157606fe3aed0d4e4857
parentc21b7e2461739e8b162f736bd9dfc6df4b48a667 (diff)
Add an option to disable video in alffplay
-rw-r--r--examples/alffplay.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}