add MatN appimage build and get rid of some compile warnings
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / fileffmpeg.C
index ff206b1011dea4569c2d09c1467fe157d0ccd86c..58125d691c8b82856759326f7891e864de0d6cb7 100644 (file)
@@ -326,7 +326,7 @@ int FileFFMPEG::open_file(int rd, int wr)
        int result = 0;
        if( ff ) return 1;
        ff = new FFMPEG(this);
-
+       
        if( rd ) {
                result = ff->init_decoder(asset->path);
                if( !result ) result = ff->open_decoder();
@@ -342,6 +342,12 @@ int FileFFMPEG::open_file(int rd, int wr)
                        int video_layers = ff->ff_total_video_layers();
                        if( video_layers > 0 ) {
                                asset->video_data = 1;
+                               asset->aspect_ratio = ff->ff_aspect_ratio(0);
+                               if (!asset->interlace_mode) asset->interlace_mode = ff->ff_interlace(0);
+                               if ( ff->ff_video_frames(0) > 1 ) {
+                               ff->video_probe(1);
+                                if (!asset->interlace_mode && (ff->interlace_from_codec) ) asset->interlace_mode = ff->video_probe(1); 
+                               }
                                if( !asset->layers ) asset->layers = video_layers;
                                asset->actual_width = ff->ff_video_width(0);
                                asset->actual_height = ff->ff_video_height(0);
@@ -1938,6 +1944,15 @@ int FFOptionsFormatView::handle_event()
 {
        Asset *asset = fmt_config->asset;
        char *format_name = asset->fformat;
+       char replace_name0[] = "mov";
+       char replace_name1[] = "mpegts";
+       char replace_name2[] = "matroska";
+       if (!strcmp(format_name, "qt"))
+               format_name = replace_name0; // fixup
+       if (!strcmp(format_name, "m2ts"))
+               format_name = replace_name1; // fixup
+       if (!strcmp(format_name, "mkv"))
+               format_name = replace_name2; // 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 ) {