Mercurial > mplayer.hg
comparison Gui/win32/interface.c @ 21429:d4cb537b3414
Replace deprecated vo_plugin_args by vf_settings.
author | diego |
---|---|
date | Sat, 02 Dec 2006 17:29:56 +0000 |
parents | 47cc96df63d0 |
children | 68a43757356d |
comparison
equal
deleted
inserted
replaced
21428:47cc96df63d0 | 21429:d4cb537b3414 |
---|---|
40 #include "wincfg.h" | 40 #include "wincfg.h" |
41 #ifdef HAVE_LIBCDIO | 41 #ifdef HAVE_LIBCDIO |
42 #include <cdio/cdio.h> | 42 #include <cdio/cdio.h> |
43 #endif | 43 #endif |
44 | 44 |
45 extern m_obj_settings_t* vo_plugin_args; | 45 extern m_obj_settings_t *vf_settings; |
46 extern vo_functions_t *video_out; | 46 extern vo_functions_t *video_out; |
47 extern ao_functions_t *audio_out; | 47 extern ao_functions_t *audio_out; |
48 extern void exit_player(const char *how); | 48 extern void exit_player(const char *how); |
49 extern char *filename; | 49 extern char *filename; |
50 extern int abs_seek_pos; | 50 extern int abs_seek_pos; |
481 } | 481 } |
482 | 482 |
483 static void add_vf(char * str) | 483 static void add_vf(char * str) |
484 { | 484 { |
485 mp_msg(MSGT_GPLAYER, MSGL_STATUS, MSGTR_AddingVideoFilter, str); | 485 mp_msg(MSGT_GPLAYER, MSGL_STATUS, MSGTR_AddingVideoFilter, str); |
486 if (vo_plugin_args) | 486 if (vf_settings) |
487 { | 487 { |
488 int i = 0; | 488 int i = 0; |
489 while (vo_plugin_args[i].name) | 489 while (vf_settings[i].name) |
490 if (!strcmp(vo_plugin_args[i++].name, str)) | 490 if (!strcmp(vf_settings[i++].name, str)) |
491 { | 491 { |
492 i = -1; | 492 i = -1; |
493 break; | 493 break; |
494 } | 494 } |
495 if (i != -1) | 495 if (i != -1) |
496 { | 496 { |
497 vo_plugin_args = realloc(vo_plugin_args, (i + 2) * sizeof(m_obj_settings_t)); | 497 vf_settings = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t)); |
498 vo_plugin_args[i].name = strdup(str); | 498 vf_settings[i].name = strdup(str); |
499 vo_plugin_args[i].attribs = NULL; | 499 vf_settings[i].attribs = NULL; |
500 vo_plugin_args[i + 1].name = NULL; | 500 vf_settings[i + 1].name = NULL; |
501 } | 501 } |
502 } | 502 } |
503 else | 503 else |
504 { | 504 { |
505 vo_plugin_args = malloc(2 * sizeof(m_obj_settings_t)); | 505 vf_settings = malloc(2 * sizeof(m_obj_settings_t)); |
506 vo_plugin_args[0].name = strdup(str); | 506 vf_settings[0].name = strdup(str); |
507 vo_plugin_args[0].attribs = NULL; | 507 vf_settings[0].attribs = NULL; |
508 vo_plugin_args[1].name = NULL; | 508 vf_settings[1].name = NULL; |
509 } | 509 } |
510 } | 510 } |
511 | 511 |
512 static void remove_vf(char * str) | 512 static void remove_vf(char * str) |
513 { | 513 { |
514 int n = 0; | 514 int n = 0; |
515 if (!vo_plugin_args ) return; | 515 if (!vf_settings ) return; |
516 | 516 |
517 mp_msg(MSGT_GPLAYER,MSGL_STATUS, MSGTR_RemovingVideoFilter, str); | 517 mp_msg(MSGT_GPLAYER,MSGL_STATUS, MSGTR_RemovingVideoFilter, str); |
518 | 518 |
519 while (vo_plugin_args[n++].name); | 519 while (vf_settings[n++].name); |
520 n--; | 520 n--; |
521 if ( n > -1 ) | 521 if ( n > -1 ) |
522 { | 522 { |
523 int i = 0, m = -1; | 523 int i = 0, m = -1; |
524 while (vo_plugin_args[i].name) | 524 while (vf_settings[i].name) |
525 if (!strcmp(vo_plugin_args[i++].name, str)) | 525 if (!strcmp(vf_settings[i++].name, str)) |
526 { | 526 { |
527 m = i - 1; | 527 m = i - 1; |
528 break; | 528 break; |
529 } | 529 } |
530 i--; | 530 i--; |
531 if (m > -1) | 531 if (m > -1) |
532 { | 532 { |
533 if (n == 1) | 533 if (n == 1) |
534 { | 534 { |
535 free(vo_plugin_args[0].name); | 535 free(vf_settings[0].name); |
536 free(vo_plugin_args[0].attribs); | 536 free(vf_settings[0].attribs); |
537 free(vo_plugin_args); | 537 free(vf_settings); |
538 vo_plugin_args=NULL; | 538 vf_settings=NULL; |
539 } | 539 } |
540 else | 540 else |
541 { | 541 { |
542 free(vo_plugin_args[i].name); | 542 free(vf_settings[i].name); |
543 free(vo_plugin_args[i].attribs); | 543 free(vf_settings[i].attribs); |
544 memcpy(&vo_plugin_args[i], &vo_plugin_args[i + 1], (n - i) * sizeof(m_obj_settings_t)); | 544 memcpy(&vf_settings[i], &vf_settings[i + 1], (n - i) * sizeof(m_obj_settings_t)); |
545 } | 545 } |
546 } | 546 } |
547 } | 547 } |
548 } | 548 } |
549 | 549 |