comparison mplayer.c @ 18286:e0470e00b3bd

simplified management of dvb channel switching
author nicodvb
date Tue, 25 Apr 2006 20:32:46 +0000
parents 5bf6b74e793c
children 292337d09af2
comparison
equal deleted inserted replaced
18285:368eac8237ea 18286:e0470e00b3bd
116 #endif 116 #endif
117 117
118 #ifdef HAS_DVBIN_SUPPORT 118 #ifdef HAS_DVBIN_SUPPORT
119 #include "libmpdemux/dvbin.h" 119 #include "libmpdemux/dvbin.h"
120 static int last_dvb_step = 1; 120 static int last_dvb_step = 1;
121 static int dvbin_reopen = 0;
121 extern void cache_uninit(stream_t *s); 122 extern void cache_uninit(stream_t *s);
122 #endif 123 #endif
123 124
124 //**************************************************************************// 125 //**************************************************************************//
125 // Playtree 126 // Playtree
3222 dir = DVB_CHANNEL_HIGHER; 3223 dir = DVB_CHANNEL_HIGHER;
3223 else 3224 else
3224 dir = DVB_CHANNEL_LOWER; 3225 dir = DVB_CHANNEL_LOWER;
3225 3226
3226 if(dvb_step_channel(priv, dir)) 3227 if(dvb_step_channel(priv, dir))
3227 { 3228 eof = dvbin_reopen = 1;
3228 uninit_player(INITED_ALL-(INITED_STREAM|INITED_INPUT));
3229 cache_uninit(stream);
3230 goto goto_enable_cache;
3231 }
3232 } 3229 }
3233 } 3230 }
3234 #endif 3231 #endif
3235 goto goto_next_file; // exit_player(MSGTR_Exit_error); 3232 goto goto_next_file; // exit_player(MSGTR_Exit_error);
3236 } 3233 }
4449 else 4446 else
4450 dir = DVB_CHANNEL_LOWER; 4447 dir = DVB_CHANNEL_LOWER;
4451 4448
4452 4449
4453 if(dvb_step_channel(priv, dir)) 4450 if(dvb_step_channel(priv, dir))
4454 { 4451 eof = dvbin_reopen = 1;
4455 uninit_player(INITED_ALL-(INITED_STREAM|INITED_INPUT));
4456 cache_uninit(stream);
4457 goto goto_enable_cache;
4458 }
4459 } 4452 }
4460 } 4453 }
4461 #endif /* HAS_DVBIN_SUPPORT */ 4454 #endif /* HAS_DVBIN_SUPPORT */
4462 break; 4455 break;
4463 case MP_CMD_TV_SET_CHANNEL : { 4456 case MP_CMD_TV_SET_CHANNEL : {
4482 last_dvb_step = 1; 4475 last_dvb_step = 1;
4483 else 4476 else
4484 last_dvb_step = -1; 4477 last_dvb_step = -1;
4485 4478
4486 if(dvb_set_channel(priv, cmd->args[1].v.i, cmd->args[0].v.i)) 4479 if(dvb_set_channel(priv, cmd->args[1].v.i, cmd->args[0].v.i))
4487 { 4480 eof = dvbin_reopen = 1;
4488 uninit_player(INITED_ALL-(INITED_STREAM|INITED_INPUT));
4489 cache_uninit(stream);
4490 goto goto_enable_cache;
4491 }
4492 } 4481 }
4493 } 4482 }
4494 } 4483 }
4495 break; 4484 break;
4496 #endif /* HAS_DVBIN_SUPPORT */ 4485 #endif /* HAS_DVBIN_SUPPORT */
5082 5071
5083 } // while(!eof) 5072 } // while(!eof)
5084 5073
5085 mp_msg(MSGT_GLOBAL,MSGL_V,"EOF code: %d \n",eof); 5074 mp_msg(MSGT_GLOBAL,MSGL_V,"EOF code: %d \n",eof);
5086 5075
5076 #ifdef HAS_DVBIN_SUPPORT
5077 if(dvbin_reopen)
5078 {
5079 eof = 0;
5080 uninit_player(INITED_ALL-(INITED_STREAM|INITED_INPUT));
5081 cache_uninit(stream);
5082 dvbin_reopen = 0;
5083 goto goto_enable_cache;
5084 }
5085 #endif
5087 } 5086 }
5088 5087
5089 goto_next_file: // don't jump here after ao/vo/getch initialization! 5088 goto_next_file: // don't jump here after ao/vo/getch initialization!
5090 5089
5091 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n"); 5090 mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n");