diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-15 20:51:55 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-09-15 20:51:55 +0000 |
commit | eafdad4b73beef6e9d5595164e9584d4ecccc525 (patch) | |
tree | 7f58f497b129dfaac07731b092290d43d98d4ede /libmpdemux/tv.c | |
parent | 4ccfe264a3accb64a1fe32c8712be5af1a2d6385 (diff) | |
download | mpv-eafdad4b73beef6e9d5595164e9584d4ecccc525.tar.bz2 mpv-eafdad4b73beef6e9d5595164e9584d4ecccc525.tar.xz |
stream layer cleanup part 2
STREAMTYPE_TV removed, use STREAMTYPE_DUMMY instead. tv init moved to demux_open
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7409 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/tv.c')
-rw-r--r-- | libmpdemux/tv.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/libmpdemux/tv.c b/libmpdemux/tv.c index 321aba8ff1..a437eada9b 100644 --- a/libmpdemux/tv.c +++ b/libmpdemux/tv.c @@ -75,7 +75,7 @@ char* tv_param_adevice = NULL; int demux_tv_fill_buffer(demuxer_t *demux, demux_stream_t *ds) { - tvi_handle_t *tvh=(tvi_handle_t*)(demux->stream->priv); + tvi_handle_t *tvh=(tvi_handle_t*)(demux->priv); demux_packet_t* dp; sh_video_t *sh_video = demux->video->sh; @@ -111,7 +111,7 @@ int demux_tv_fill_buffer(demuxer_t *demux, demux_stream_t *ds) return 1; } -int stream_open_tv(stream_t *stream, tvi_handle_t *tvh) +static int open_tv(tvi_handle_t *tvh) { int i; tvi_functions_t *funcs = tvh->functions; @@ -257,10 +257,19 @@ done: int demux_open_tv(demuxer_t *demuxer) { - tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->stream->priv); - sh_video_t *sh_video = NULL; + tvi_handle_t *tvh; + sh_video_t *sh_video; sh_audio_t *sh_audio = NULL; - tvi_functions_t *funcs = tvh->functions; + tvi_functions_t *funcs; + + if(!(tvh=tv_begin())) return 0; + if (!tv_init(tvh)) return 0; + if (!open_tv(tvh)){ + tv_uninit(tvh); + return 0; + } + funcs = tvh->functions; + demuxer->priv=tvh; sh_video = new_sh_video(demuxer, 0); @@ -387,7 +396,7 @@ no_audio: #if defined(USE_TV) && defined(HAVE_TV_V4L) int demux_close_tv(demuxer_t *demuxer) { - tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->stream->priv); + tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv); return(tvh->functions->uninit(tvh->priv)); } #endif |