aboutsummaryrefslogtreecommitdiffhomepage
path: root/libvo
diff options
context:
space:
mode:
authorGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-02 20:34:48 +0000
committerGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-02 20:34:48 +0000
commit1b3cb7845ad5b695cfbc468d705d86f793cb5838 (patch)
treedf876170c7fa1b470bd19fa2b0e25000a1ca2b8a /libvo
parentf09d652df81c2f9b8ec5a258de3144614cd38399 (diff)
when :card isn't specified by the user search the first available card
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25586 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_mpegpes.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libvo/vo_mpegpes.c b/libvo/vo_mpegpes.c
index 05e81631f7..d251ff75df 100644
--- a/libvo/vo_mpegpes.c
+++ b/libvo/vo_mpegpes.c
@@ -98,7 +98,7 @@ config(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t height, uin
static int preinit(const char *arg){
#ifdef HAVE_DVB
- int card = 0;
+ int card = -1;
char vo_file[30], ao_file[30], *tmp;
if(arg != NULL){
@@ -115,6 +115,21 @@ static int preinit(const char *arg){
if(!arg){
//|O_NONBLOCK
+ //search the first usable card
+ if(card==-1) {
+ int n;
+ for(n=0; n<4; n++) {
+ sprintf(vo_file, "/dev/dvb/adapter%d/video0", n);
+ if(access(vo_file, F_OK | W_OK)==0) {
+ card = n;
+ break;
+ }
+ }
+ }
+ if(card==-1) {
+ mp_msg(MSGT_VO,MSGL_INFO, "Couldn't find a usable dvb video device, exiting\n");
+ return -1;
+ }
#ifndef HAVE_DVB_HEAD
mp_msg(MSGT_VO,MSGL_INFO, "Opening /dev/ost/video+audio\n");
sprintf(vo_file, "/dev/ost/video");