From f63193f58f7214ef3a4f82be045f8a3cfd14b8ac Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 12 Jul 2013 22:07:07 +0200 Subject: 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. --- stream/vcd_read.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'stream/vcd_read.h') diff --git a/stream/vcd_read.h b/stream/vcd_read.h index 2d4a88604a..92a9c53b78 100644 --- a/stream/vcd_read.h +++ b/stream/vcd_read.h @@ -147,10 +147,12 @@ static mp_vcd_priv_t* vcd_read_toc(int fd){ return vcd; } +/* static int vcd_end_track(mp_vcd_priv_t* vcd) { return vcd->tochdr.cdth_trk1; } +*/ static int vcd_read(mp_vcd_priv_t* vcd,char *mem){ #ifndef sun -- cgit v1.2.3