+ ret = 1;
+ }
+ avcodec_free_context(&avctx);
+ if( !ret && !(avctx = avcodec_alloc_context3(codec)) ) {
+ eprintf(_("no codec context: %s: %s"), name, video_codec);
+ ret = 1;
+ }
+
+ if( !ret ) {
+ const void *obj = (const void *)avctx->priv_data;
+ vid_config->start(obj);
+ }
+ return 1;
+}
+
+FFOptionsViewFormat::FFOptionsViewFormat(BC_WindowBase *parent_window,
+ EDL *edl, Asset *asset, int x, int y, const char *text)
+ : BC_GenericButton(x, y, text)
+{
+ this->parent_window = parent_window;
+ this->edl = edl;
+ this->asset = asset;
+ format_dialog = 0;
+}
+
+FFOptionsViewFormat::~FFOptionsViewFormat()
+{
+ delete format_dialog;
+}
+
+int FFOptionsViewFormat::handle_event()
+{
+ delete format_dialog;
+ int wx, wy;
+ get_pop_cursor(wx, wy);
+ format_dialog = new FFOptionsFormatViewDialog(this, wx, wy);
+ format_dialog->start();
+ return 1;
+}
+
+
+FFOptionsFormatView::FFOptionsFormatView(FFMPEGConfigFormat *fmt_config,
+ int x, int y, const char *text)
+ : BC_GenericButton(x, y, text)
+{
+ this->fmt_config = fmt_config;
+ fmt_ctx = 0;
+}
+
+FFOptionsFormatView::~FFOptionsFormatView()
+{
+ avformat_free_context(fmt_ctx);
+}
+
+int FFOptionsFormatView::handle_event()
+{
+ Asset *asset = fmt_config->asset;
+ char *format_name = asset->fformat;
+ 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 ) {
+ const void *obj = fmt_ctx->priv_data;
+ fmt_config->start(obj);