awindowgui / mwindowedit / label rework
[goodguy/history.git] / cinelerra-5.1 / cinelerra / fileffmpeg.C
index 5542c97587ab7f976e2c57fc38db699917811969..27bd7de45daa2022ec46d38c2793d32b30cfd1ce 100644 (file)
@@ -210,7 +210,6 @@ int FileFFMPEG::select_video_stream(Asset *asset, int vstream)
        if( !ff || !asset->video_data ) return 1;
        asset->width = ff->ff_video_width(vstream);
        asset->height = ff->ff_video_height(vstream);
-       asset->video_length = ff->ff_video_frames(vstream);
        if( (asset->video_length = ff->ff_video_frames(vstream)) < 2 )
                asset->video_length = asset->video_length < 0 ? 0 : -1;
        asset->frame_rate = ff->ff_frame_rate(vstream);
@@ -241,6 +240,7 @@ int FileFFMPEG::open_file(int rd, int wr)
                                asset->channels = audio_channels;
                                asset->sample_rate = ff->ff_sample_rate(0);
                                asset->audio_length = ff->ff_audio_samples(0);
+                               strcpy(asset->acodec, ff->ff_audio_format(0));
                        }
                        int video_layers = ff->ff_total_video_layers();
                        if( video_layers > 0 ) {
@@ -254,6 +254,7 @@ int FileFFMPEG::open_file(int rd, int wr)
                                    (asset->video_length = ff->ff_video_frames(0)) < 2 )
                                        asset->video_length = asset->video_length < 0 ? 0 : -1;
                                if( !asset->frame_rate ) asset->frame_rate = ff->ff_frame_rate(0);
+                               strcpy(asset->vcodec, ff->ff_video_format(0));
                        }
                        IndexState *index_state = asset->index_state;
                        index_state->read_markers(file->preferences->index_directory, asset->path);