[Cin] small fix for qt vs mov format option
Andrew Randrianasulu
randrianasulu at gmail.com
Tue Nov 17 02:01:48 CET 2020
I basically hacked fileffmpeg.C so it will allow me to choose mov flags for (cin-specific) qt 'format'. Of course one can rename all those qt profiles too...
int FFOptionsFormatView::handle_event()
{
Asset *asset = fmt_config->asset;
char *format_name = asset->fformat;
char *replace_name = "mov";
if (!strcmp(format_name, "qt"))
format_name = replace_name; // fixup
avformat_free_context(fmt_ctx); fmt_ctx = 0;
int ret = avformat_alloc_output_context2(&fmt_ctx, 0, format_name, 0);
if( ret || !fmt_ctx ) {
eprintf(_("no format named: %s"), format_name);
ret = 1;
}
if( !ret )
fmt_config->start(fmt_ctx);
return 1;
}
basically just three lines. But I have other changes for this file so diff will be not clean.
===
iff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C
index ff206b10..d0d58290 100644
--- a/cinelerra-5.1/cinelerra/fileffmpeg.C
+++ b/cinelerra-5.1/cinelerra/fileffmpeg.C
@@ -1938,6 +1943,9 @@ int FFOptionsFormatView::handle_event()
{
Asset *asset = fmt_config->asset;
char *format_name = asset->fformat;
+ char *replace_name = "mov";
+ if (!strcmp(format_name, "qt"))
+ format_name = replace_name; // fixup
avformat_free_context(fmt_ctx); fmt_ctx = 0;
int ret = avformat_alloc_output_context2(&fmt_ctx, 0, format_name, 0);
if( ret || !fmt_ctx ) {
===
I killed additional lines, but then linecount can be wrong ...
More information about the Cin
mailing list