comparison mplayer.c @ 10560:11826d9f90c7

this patch fixes 1) some bugs introduced in the tuner autodetection and in the channel-parsing functions, 3) retries reading when the mplayer/mencoder don't read fast enough (sooner it exited) but especially 4) makes the stream compliant with the new, modular stream api (the one currently in CVS is not and is totally unreachable). [and maybe more, next time please include cvslog in patch! -- A'rpi] patch by Nico <nsabbi@libero.it>
author arpi
date Mon, 11 Aug 2003 00:02:46 +0000
parents 2bb2903dfb7e
children 7e5733a8c33b
comparison
equal deleted inserted replaced
10559:c958cd92337a 10560:11826d9f90c7
98 #include "libmpdemux/tv.h" 98 #include "libmpdemux/tv.h"
99 #endif 99 #endif
100 100
101 #ifdef HAS_DVBIN_SUPPORT 101 #ifdef HAS_DVBIN_SUPPORT
102 #include "libmpdemux/dvbin.h" 102 #include "libmpdemux/dvbin.h"
103 extern dvb_history_t dvb_prev_next;
104 dvb_history_t *dvb_history;
105 #endif 103 #endif
106 104
107 105
108 //**************************************************************************// 106 //**************************************************************************//
109 // Playtree 107 // Playtree
741 739
742 int i; 740 int i;
743 char *tmp; 741 char *tmp;
744 742
745 int gui_no_filename=0; 743 int gui_no_filename=0;
746
747 #ifdef HAS_DVBIN_SUPPORT
748 dvb_prev_next.prev = dvb_prev_next.next = -1;
749 dvb_history = &dvb_prev_next;
750 #endif
751
752 744
753 745
754 srand((int) time(NULL)); 746 srand((int) time(NULL));
755 747
756 mp_msg_init(); 748 mp_msg_init();
1335 if(!stream_enable_cache(stream,stream_cache_size*1024,stream_cache_size*1024/5,stream_cache_size*1024/20)) 1327 if(!stream_enable_cache(stream,stream_cache_size*1024,stream_cache_size*1024/5,stream_cache_size*1024/20))
1336 if((eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY))) goto goto_next_file; 1328 if((eof = libmpdemux_was_interrupted(PT_NEXT_ENTRY))) goto goto_next_file;
1337 } 1329 }
1338 1330
1339 //============ Open DEMUXERS --- DETECT file type ======================= 1331 //============ Open DEMUXERS --- DETECT file type =======================
1340 1332 goto_open_demuxer:
1341 current_module="demux_open"; 1333 current_module="demux_open";
1342 1334
1343 demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename); 1335 demuxer=demux_open(stream,file_format,audio_id,video_id,dvdsub_id,filename);
1344 1336
1345 // HACK to get MOV Reference Files working 1337 // HACK to get MOV Reference Files working
2806 #endif 2798 #endif
2807 } 2799 }
2808 } 2800 }
2809 } 2801 }
2810 #ifdef HAS_DVBIN_SUPPORT 2802 #ifdef HAS_DVBIN_SUPPORT
2811 if(dvbin_param_on == 1) 2803 if((stream->type == STREAMTYPE_DVB) && stream->priv)
2812 { 2804 {
2805 dvb_priv_t *priv = (dvb_priv_t*) stream->priv;
2806 if(priv->is_on)
2807 {
2808 int dir;
2813 int v = cmd->args[0].v.i; 2809 int v = cmd->args[0].v.i;
2810
2814 if(v > 0) 2811 if(v > 0)
2815 dvb_history = dvb_step_channel((dvb_priv_t*)(demuxer->stream->priv), DVB_CHANNEL_HIGHER, dvb_history); 2812 dir = DVB_CHANNEL_HIGHER;
2816 else 2813 else
2817 dvb_history = dvb_step_channel((dvb_priv_t*)(demuxer->stream->priv), DVB_CHANNEL_LOWER, dvb_history); 2814 dir = DVB_CHANNEL_LOWER;
2818 uninit_player(INITED_ALL); 2815
2819 goto goto_next_file; 2816
2817 if(dvb_step_channel(priv, dir))
2818 {
2819 uninit_player(INITED_ALL-(INITED_STREAM));
2820 printf("UNINIT COMPLETE\n");
2821 goto goto_open_demuxer;
2822 }
2823 }
2820 } 2824 }
2821 #endif 2825 #endif
2822
2823 break; 2826 break;
2824 case MP_CMD_TV_SET_CHANNEL : { 2827 case MP_CMD_TV_SET_CHANNEL : {
2825 if (file_format == DEMUXER_TYPE_TV) { 2828 if (file_format == DEMUXER_TYPE_TV) {
2826 tv_set_channel((tvi_handle_t*)(demuxer->priv), cmd->args[0].v.s); 2829 tv_set_channel((tvi_handle_t*)(demuxer->priv), cmd->args[0].v.s);
2827 #ifdef USE_OSD 2830 #ifdef USE_OSD
2830 vo_osd_changed(OSDTYPE_SUBTITLE); 2833 vo_osd_changed(OSDTYPE_SUBTITLE);
2831 } 2834 }
2832 #endif 2835 #endif
2833 } 2836 }
2834 } break; 2837 } break;
2838 #ifdef HAS_DVBIN_SUPPORT
2839 case MP_CMD_DVB_SET_CHANNEL:
2840 {
2841 if((stream->type == STREAMTYPE_DVB) && stream->priv)
2842 {
2843 dvb_priv_t *priv = (dvb_priv_t*) stream->priv;
2844 if(priv->is_on)
2845 {
2846 if(dvb_set_channel(priv, cmd->args[0].v.i))
2847 {
2848 uninit_player(INITED_ALL-(INITED_STREAM));
2849 goto goto_open_demuxer;
2850 }
2851 }
2852 }
2853 }
2854 #endif
2835 case MP_CMD_TV_LAST_CHANNEL : { 2855 case MP_CMD_TV_LAST_CHANNEL : {
2836 if (file_format == DEMUXER_TYPE_TV) { 2856 if (file_format == DEMUXER_TYPE_TV) {
2837 tv_last_channel((tvi_handle_t*)(demuxer->priv)); 2857 tv_last_channel((tvi_handle_t*)(demuxer->priv));
2838 #ifdef USE_OSD 2858 #ifdef USE_OSD
2839 if (tv_channel_list) { 2859 if (tv_channel_list) {
3572 #endif 3592 #endif
3573 mplEnd(); 3593 mplEnd();
3574 } 3594 }
3575 #endif 3595 #endif
3576 3596
3577 if(use_gui || playtree_iter != NULL 3597 if(use_gui || playtree_iter != NULL){
3578 #ifdef HAS_DVBIN_SUPPORT
3579 || dvbin_param_on
3580 #endif
3581 ){
3582 3598
3583 eof = 0; 3599 eof = 0;
3584 goto play_next_file; 3600 goto play_next_file;
3585 } 3601 }
3586 3602