From c15ea80d0990a701eeaa463909842654bd579fb7 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Sun, 3 Apr 2022 13:04:14 -0400 Subject: [PATCH] Update NSMovie.m, start cleaning up ffplay.m --- Source/NSMovie.m | 1 + Tools/video/ffplay.m | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/NSMovie.m b/Source/NSMovie.m index ccc223dc2..ed21ab835 100644 --- a/Source/NSMovie.m +++ b/Source/NSMovie.m @@ -245,6 +245,7 @@ static inline void _loadNSMoviePlugIns (void) new->_movie = _movie; new->_movieData = [_movieData copyWithZone: zone]; new->_url = [_url copyWithZone: zone]; + return new; } diff --git a/Tools/video/ffplay.m b/Tools/video/ffplay.m index fa95a13cc..14e643bd1 100644 --- a/Tools/video/ffplay.m +++ b/Tools/video/ffplay.m @@ -63,6 +63,9 @@ #include +#import +#import + const char program_name[] = "ffplay"; const int program_birth_year = 2003; @@ -3680,7 +3683,7 @@ void show_help_default(const char *opt, const char *arg) } /* Called from the main */ -int main(int argc, char **argv) +int video_main(NSMovie *movie, NSMovieView *view) //(int argc, char **argv) { int flags; VideoState *is; @@ -3688,7 +3691,7 @@ int main(int argc, char **argv) init_dynload(); av_log_set_flags(AV_LOG_SKIP_REPEATED); - parse_loglevel(argc, argv, options); + // parse_loglevel(argc, argv, options); /* register all codecs, demux and protocols */ #if CONFIG_AVDEVICE @@ -3701,10 +3704,10 @@ int main(int argc, char **argv) signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */ signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */ - show_banner(argc, argv, options); - - parse_options(NULL, argc, argv, options, opt_input_file); + // show_banner(argc, argv, options); + // parse_options(NULL, argc, argv, options, opt_input_file); + input_filename = [[[NSMovie URL] path] cString]; if (!input_filename) { show_usage(); av_log(NULL, AV_LOG_FATAL, "An input file must be specified\n");