summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvb.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-12 22:07:07 +0200
committerwm4 <wm4@nowhere>2013-07-12 22:16:26 +0200
commitf63193f58f7214ef3a4f82be045f8a3cfd14b8ac (patch)
tree77bc53b7125730af961fb8b9298ef00f128d6576 /stream/stream_dvb.c
parentb66c609b4826059d348f6e1c049a34cc43415383 (diff)
downloadmpv-f63193f58f7214ef3a4f82be045f8a3cfd14b8ac.tar.bz2
mpv-f63193f58f7214ef3a4f82be045f8a3cfd14b8ac.tar.xz
stream: remove fd member
Stream implementations could set this to a unix file descriptor. The generic stream code could use it as fallback for a few things. This was confusing and insane. In most cases, the stream implementations defined all callbacks, so setting the fd member didn't have any advantages, other than avoiding defining a private struct to store it. It appears that even if the stream implementation used close() on the fd (or something equivalent), stream.c would close() it a second time (and on windows, even would call closesocket()), which should be proof for the insanity of this code. For stream_file.c, additionally make sure we don't close stdin or stdout if "-" is used as filename. For stream_vcd.c, remove the control() code. This code most likely didn't make the slightest sense, because it used a different type for stream->priv. It also leaked memory. Maybe it worked, but it's incorrect and insignificant anyway, so kill it. This code was added with commit 9521c19 (svn commit 31019). Untested for all protocols other than stream_file.c.
Diffstat (limited to 'stream/stream_dvb.c')
-rw-r--r--stream/stream_dvb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c
index 6dbdf7b0b9..898d57221b 100644
--- a/stream/stream_dvb.c
+++ b/stream/stream_dvb.c
@@ -443,7 +443,7 @@ static int dvb_streaming_read(stream_t *stream, char *buffer, int size)
tries = priv->retry + 1;
- fd = stream->fd;
+ fd = priv->fd;
while(pos < size)
{
pfds[0].fd = fd;
@@ -535,7 +535,7 @@ int dvb_set_channel(stream_t *stream, int card, int n)
priv->list = new_list;
priv->retry = 5;
new_list->current = n;
- stream->fd = priv->dvr_fd;
+ priv->fd = priv->dvr_fd;
mp_msg(MSGT_DEMUX, MSGL_V, "DVB_SET_CHANNEL: new channel name=%s, card: %d, channel %d\n", channel->name, card, n);
stream->buf_pos = stream->buf_len = 0;