summaryrefslogtreecommitdiffstats
path: root/stream/tv.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/tv.c')
-rw-r--r--stream/tv.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/stream/tv.c b/stream/tv.c
index 1fcb13037d..e5768a350a 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -708,7 +708,8 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
funcs = tvh->functions;
demuxer->priv=tvh;
- sh_video = new_sh_video(demuxer, 0);
+ struct sh_stream *sh_v = new_sh_stream(demuxer, STREAM_VIDEO);
+ sh_video = sh_v->video;
/* get IMAGE FORMAT */
int fourcc;
@@ -738,20 +739,12 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
tvh->tv_param->noaudio = 1;
}
- /* disable TV audio if -nosound is present */
- if (!demuxer->audio || demuxer->audio->id == -2) {
- tvh->tv_param->noaudio = 1;
- }
-
/* set width */
funcs->control(tvh->priv, TVI_CONTROL_VID_GET_WIDTH, &sh_video->disp_w);
/* set height */
funcs->control(tvh->priv, TVI_CONTROL_VID_GET_HEIGHT, &sh_video->disp_h);
- demuxer->video->sh = sh_video;
- sh_video->ds = demuxer->video;
- demuxer->video->id = 0;
demuxer->seekable = 0;
/* here comes audio init */
@@ -786,7 +779,8 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
goto no_audio;
}
- sh_audio = new_sh_audio(demuxer, 0);
+ struct sh_stream *sh_a = new_sh_stream(demuxer, STREAM_AUDIO);
+ sh_audio = sh_a->audio;
funcs->control(tvh->priv, TVI_CONTROL_AUD_GET_SAMPLERATE,
&sh_audio->samplerate);
@@ -816,10 +810,6 @@ static demuxer_t* demux_open_tv(demuxer_t *demuxer)
mp_tmsg(MSGT_DECVIDEO, MSGL_V, " TV audio: %d channels, %d bits, %d Hz\n",
sh_audio->wf->nChannels, sh_audio->wf->wBitsPerSample,
sh_audio->wf->nSamplesPerSec);
-
- demuxer->audio->sh = sh_audio;
- sh_audio->ds = demuxer->audio;
- demuxer->audio->id = 0;
}
no_audio: