mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-15 19:40:07 +01:00
fftools/ffmpeg: replace MATCH_PER_STREAM_OPT(.., str, ..) with a function
This has multiple advantages: * The macro has multiple parameters that often have similar or identical values, yet very different meanings (one is the name of the OptionsContext member where the parsed options are stored, the other the name of the variable into which the result is written); this change makes each of these explicit. * The macro returns on failure, which may cause leaks - this was the reason for adding MATCH_PER_STREAM_OPT_CLEAN(), also ost_add() currently leaks encoder_opts. The new function returns failure to its caller, which decides how to deal with it. While that adds a lot of error checks/forwards for now, those will be reduced in following commits. * new code is type- and const- correct Invocations of MATCH_PER_STREAM_OPT() with other types will be converted in following commits.
This commit is contained in:
@@ -593,7 +593,7 @@ typedef struct OutputStream {
|
||||
|
||||
KeyframeForceCtx kf;
|
||||
|
||||
char *logfile_prefix;
|
||||
const char *logfile_prefix;
|
||||
FILE *logfile;
|
||||
|
||||
// simple filtergraph feeding this stream, if any
|
||||
@@ -902,6 +902,8 @@ void update_benchmark(const char *fmt, ...);
|
||||
|
||||
const char *opt_match_per_type_str(const SpecifierOptList *sol,
|
||||
char mediatype);
|
||||
int opt_match_per_stream_str(void *logctx, const SpecifierOptList *sol,
|
||||
AVFormatContext *fc, AVStream *st, const char **out);
|
||||
|
||||
int muxer_thread(void *arg);
|
||||
int encoder_thread(void *arg);
|
||||
|
||||
Reference in New Issue
Block a user