comparison gui/interface.c @ 37075:3021ac203d3c

Rewrite add_vf(). Add a parameter in order to pass options to a video filter to be added.
author ib
date Thu, 24 Apr 2014 13:17:00 +0000
parents 1bcac20d3393
children 60835d705f76
comparison
equal deleted inserted replaced
37074:1bcac20d3393 37075:3021ac203d3c
273 } 273 }
274 274
275 mp_msg(MSGT_GPLAYER, MSGL_V, "GUI done.\n"); 275 mp_msg(MSGT_GPLAYER, MSGL_V, "GUI done.\n");
276 } 276 }
277 277
278 static void add_vf(const char *vf) 278 static void add_vf(const char *vf, const char *const *argvf)
279 { 279 {
280 if (vf_settings) { 280 if (vf_settings) {
281 int i = 0; 281 int i = 0;
282 282
283 while (vf_settings[i].name) { 283 while (vf_settings[i].name) {
293 if (!settings) 293 if (!settings)
294 return; 294 return;
295 295
296 vf_settings = settings; 296 vf_settings = settings;
297 vf_settings[i].name = strdup(vf); 297 vf_settings[i].name = strdup(vf);
298 vf_settings[i].attribs = NULL; 298 vf_settings[i].attribs = listDup(argvf);
299 memset(&vf_settings[i + 1], 0, sizeof(m_obj_settings_t)); 299 memset(&vf_settings[i + 1], 0, sizeof(m_obj_settings_t));
300 } 300 }
301 } else { 301 } else {
302 vf_settings = calloc(2, sizeof(m_obj_settings_t)); 302 vf_settings = calloc(2, sizeof(m_obj_settings_t));
303 303
304 if (!vf_settings) 304 if (!vf_settings)
305 return; 305 return;
306 306
307 vf_settings[0].name = strdup(vf); 307 vf_settings[0].name = strdup(vf);
308 vf_settings[0].attribs = NULL; 308 vf_settings[0].attribs = listDup(argvf);
309 } 309 }
310 310
311 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_AddingVideoFilter, vf); 311 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_GUI_MSG_AddingVideoFilter, vf);
312 } 312 }
313 313
503 } 503 }
504 504
505 if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3")) 505 if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3"))
506 if (guiInfo.StreamType != STREAMTYPE_DVD && guiInfo.StreamType != STREAMTYPE_VCD) 506 if (guiInfo.StreamType != STREAMTYPE_DVD && guiInfo.StreamType != STREAMTYPE_VCD)
507 if (gtkVfLAVC) 507 if (gtkVfLAVC)
508 add_vf("lavc"); 508 add_vf("lavc", NULL);
509 509
510 if (gtkVfPP) 510 if (gtkVfPP)
511 add_vf("pp"); 511 add_vf("pp", NULL);
512 512
513 /* audio opts */ 513 /* audio opts */
514 514
515 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; } 515 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; }
516 if (gtkAONorm) 516 if (gtkAONorm)