summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.c34
-rw-r--r--stream/stream.h5
2 files changed, 0 insertions, 39 deletions
diff --git a/stream/stream.c b/stream/stream.c
index 4c7aa04844..d2c2917d56 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -353,37 +353,6 @@ static bool stream_reconnect(stream_t *s)
return false;
}
-static void stream_capture_write(stream_t *s, void *buf, size_t len)
-{
- if (s->capture_file && len > 0) {
- if (fwrite(buf, len, 1, s->capture_file) < 1) {
- MP_ERR(s, "Error writing capture file: %s\n", mp_strerror(errno));
- stream_set_capture_file(s, NULL);
- }
- }
-}
-
-void stream_set_capture_file(stream_t *s, const char *filename)
-{
- if (!bstr_equals(bstr0(s->capture_filename), bstr0(filename))) {
- if (s->capture_file)
- fclose(s->capture_file);
- talloc_free(s->capture_filename);
- s->capture_file = NULL;
- s->capture_filename = NULL;
- if (filename) {
- s->capture_file = fopen(filename, "ab");
- if (s->capture_file) {
- s->capture_filename = talloc_strdup(NULL, filename);
- if (s->buf_pos < s->buf_len)
- stream_capture_write(s, s->buffer, s->buf_len);
- } else {
- MP_ERR(s, "Error opening capture file: %s\n", mp_strerror(errno));
- }
- }
- }
-}
-
// Read function bypassing the local stream buffer. This will not write into
// s->buffer, but into buf[0..len] instead.
// Returns 0 on error or EOF, and length of bytes read on success.
@@ -412,7 +381,6 @@ static int stream_read_unbuffered(stream_t *s, void *buf, int len)
// When reading succeeded we are obviously not at eof.
s->eof = 0;
s->pos += len;
- stream_capture_write(s, buf, len);
return len;
}
@@ -647,8 +615,6 @@ void free_stream(stream_t *s)
if (!s)
return;
- stream_set_capture_file(s, NULL);
-
if (s->close)
s->close(s);
free_stream(s->uncached_stream);
diff --git a/stream/stream.h b/stream/stream.h
index 7d44e30eae..f309ab1b86 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -203,9 +203,6 @@ typedef struct stream {
struct mp_cancel *cancel; // cancellation notification
- FILE *capture_file;
- char *capture_filename;
-
struct stream *uncached_stream; // underlying stream for cache wrapper
// Includes additional padding in case sizes get rounded up by sector size.
@@ -214,8 +211,6 @@ typedef struct stream {
int stream_fill_buffer(stream_t *s);
-void stream_set_capture_file(stream_t *s, const char *filename);
-
struct mp_cache_opts;
bool stream_wants_cache(stream_t *stream, struct mp_cache_opts *opts);
int stream_enable_cache_defaults(stream_t **stream);