comparison stream/tv.c @ 23879:26a32eda1603

Cosmetics: move two routines up to avoid requirement of forward declarations.
author voroshil
date Sun, 29 Jul 2007 03:33:39 +0000
parents 9fb716ab06a3
children 1c888cc4ebbb
comparison
equal deleted inserted replaced
23878:e64c59f73527 23879:26a32eda1603
503 done: 503 done:
504 /* also start device! */ 504 /* also start device! */
505 return 1; 505 return 1;
506 } 506 }
507 507
508 /* ================== STREAM_TV ===================== */
509
510 tvi_handle_t *tv_begin(void)
511 {
512 int i;
513 tvi_handle_t* h;
514 if(!strcmp(tv_param_driver,"help")){
515 mp_msg(MSGT_TV,MSGL_INFO,MSGTR_TV_AvailableDrivers);
516 for(i=0;tvi_driver_list[i];i++){
517 mp_msg(MSGT_TV,MSGL_INFO," %s\t%s",tvi_driver_list[i]->short_name,tvi_driver_list[i]->name);
518 if(tvi_driver_list[i]->comment)
519 mp_msg(MSGT_TV,MSGL_INFO," (%s)",tvi_driver_list[i]->comment);
520 mp_msg(MSGT_TV,MSGL_INFO,"\n");
521 }
522 return NULL;
523 }
524
525 for(i=0;tvi_driver_list[i];i++){
526 if (!strcmp(tvi_driver_list[i]->short_name, tv_param_driver)){
527 h=tvi_driver_list[i]->tvi_init(tv_param_device,tv_param_adevice);
528 if(!h) return NULL;
529
530 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_DriverInfo, tvi_driver_list[i]->short_name,
531 tvi_driver_list[i]->name,
532 tvi_driver_list[i]->author,
533 tvi_driver_list[i]->comment?tvi_driver_list[i]->comment:"");
534 return h;
535 }
536 }
537
538 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoSuchDriver, tv_param_driver);
539 return(NULL);
540 }
541
508 static demuxer_t* demux_open_tv(demuxer_t *demuxer) 542 static demuxer_t* demux_open_tv(demuxer_t *demuxer)
509 { 543 {
510 tvi_handle_t *tvh; 544 tvi_handle_t *tvh;
511 sh_video_t *sh_video; 545 sh_video_t *sh_video;
512 sh_audio_t *sh_audio = NULL; 546 sh_audio_t *sh_audio = NULL;
659 { 693 {
660 tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv); 694 tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv);
661 if (!tvh) return; 695 if (!tvh) return;
662 tvh->functions->uninit(tvh->priv); 696 tvh->functions->uninit(tvh->priv);
663 demuxer->priv=NULL; 697 demuxer->priv=NULL;
664 }
665
666 /* ================== STREAM_TV ===================== */
667
668 tvi_handle_t *tv_begin(void)
669 {
670 int i;
671 tvi_handle_t* h;
672 if(!strcmp(tv_param_driver,"help")){
673 mp_msg(MSGT_TV,MSGL_INFO,MSGTR_TV_AvailableDrivers);
674 for(i=0;tvi_driver_list[i];i++){
675 mp_msg(MSGT_TV,MSGL_INFO," %s\t%s",tvi_driver_list[i]->short_name,tvi_driver_list[i]->name);
676 if(tvi_driver_list[i]->comment)
677 mp_msg(MSGT_TV,MSGL_INFO," (%s)",tvi_driver_list[i]->comment);
678 mp_msg(MSGT_TV,MSGL_INFO,"\n");
679 }
680 return NULL;
681 }
682
683 for(i=0;tvi_driver_list[i];i++){
684 if (!strcmp(tvi_driver_list[i]->short_name, tv_param_driver)){
685 h=tvi_driver_list[i]->tvi_init(tv_param_device,tv_param_adevice);
686 if(!h) return NULL;
687
688 mp_msg(MSGT_TV, MSGL_INFO, MSGTR_TV_DriverInfo, tvi_driver_list[i]->short_name,
689 tvi_driver_list[i]->name,
690 tvi_driver_list[i]->author,
691 tvi_driver_list[i]->comment?tvi_driver_list[i]->comment:"");
692 return h;
693 }
694 }
695
696 mp_msg(MSGT_TV, MSGL_ERR, MSGTR_TV_NoSuchDriver, tv_param_driver);
697 return(NULL);
698 } 698 }
699 699
700 int tv_uninit(tvi_handle_t *tvh) 700 int tv_uninit(tvi_handle_t *tvh)
701 { 701 {
702 int res; 702 int res;