summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-11 20:08:12 +0200
committerwm4 <wm4@nowhere>2013-07-11 21:09:39 +0200
commitd17d2fdc7c536821b3fea8c4a37c0ad09fc487db (patch)
tree88e2dcaa89ea98478bd7831a87febb4c8ba7435c /stream
parent3a7fa5b186fc130c159b072cb86194644f9876fb (diff)
downloadmpv-d17d2fdc7c536821b3fea8c4a37c0ad09fc487db.tar.bz2
mpv-d17d2fdc7c536821b3fea8c4a37c0ad09fc487db.tar.xz
demux: change signature of open functions, cleanups
Preparation for redoing the open functions.
Diffstat (limited to 'stream')
-rw-r--r--stream/tv.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/stream/tv.c b/stream/tv.c
index 2c930781bc..aa5383402f 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -701,7 +701,7 @@ static int tv_uninit(tvi_handle_t *tvh)
return res;
}
-static demuxer_t* demux_open_tv(demuxer_t *demuxer)
+static int demux_open_tv(demuxer_t *demuxer)
{
tvi_handle_t *tvh;
sh_video_t *sh_video;
@@ -709,14 +709,14 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
const tvi_functions_t *funcs;
demuxer->priv=NULL;
- if(!(tvh=tv_begin(demuxer->stream->priv))) return NULL;
- if (!tvh->functions->init(tvh->priv)) return NULL;
+ if(!(tvh=tv_begin(demuxer->stream->priv))) return -1;
+ if (!tvh->functions->init(tvh->priv)) return -1;
tvh->demuxer = demuxer;
if (!open_tv(tvh)){
tv_uninit(tvh);
- return NULL;
+ return -1;
}
funcs = tvh->functions;
demuxer->priv=tvh;
@@ -827,7 +827,7 @@ no_audio:
if(!(funcs->start(tvh->priv))){
// start failed :(
tv_uninit(tvh);
- return NULL;
+ return -1;
}
/* set color eq */
@@ -840,7 +840,7 @@ no_audio:
if(funcs->control(tvh->priv,TVI_CONTROL_VID_SET_GAIN,&tvh->tv_param->gain)!=TVI_CONTROL_TRUE)
mp_msg(MSGT_TV,MSGL_WARN,"Unable to set gain control!\n");
- return demuxer;
+ return 0;
}
static void demux_close_tv(demuxer_t *demuxer)
@@ -1094,17 +1094,13 @@ int tv_step_chanlist(tvi_handle_t *tvh)
}
demuxer_desc_t demuxer_desc_tv = {
- "Tv card demuxer",
- "tv",
- "TV",
- "Alex Beregszaszi, Charles R. Henrich",
- "?",
- DEMUXER_TYPE_TV,
- 0, // no autodetect
- NULL,
- demux_tv_fill_buffer,
- demux_open_tv,
- demux_close_tv,
- NULL,
- NULL
+ .info = "Tv card demuxer",
+ .name = "tv",
+ .shortdesc = "TV",
+ .author = "Alex Beregszaszi, Charles R. Henrich",
+ .comment = "?",
+ .type = DEMUXER_TYPE_TV,
+ .fill_buffer = demux_tv_fill_buffer,
+ .open = demux_open_tv,
+ .close = demux_close_tv,
};