From 7059c15f4af047d29bed9ea8b17a3702980b8442 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 2 Aug 2012 22:47:56 +0200 Subject: mplayer: rip out --capture support While this was an interesting idea, it wasn't actually useful. Basically it dumped the raw data (as requested by the demuxer) into a file. The result is only useful if the file format was raw or maybe some MPEG packet stream, but not with most modern file formats. --- stream/cache2.c | 2 -- stream/stream.c | 16 ---------------- stream/stream.h | 2 -- 3 files changed, 20 deletions(-) (limited to 'stream') diff --git a/stream/cache2.c b/stream/cache2.c index 47bc76a4f9..4fb663aca6 100644 --- a/stream/cache2.c +++ b/stream/cache2.c @@ -527,8 +527,6 @@ int cache_stream_fill_buffer(stream_t *s){ s->buf_len=len; s->pos+=len; // printf("[%d]",len);fflush(stdout); - if (s->capture_file) - stream_capture_do(s); return len; } diff --git a/stream/stream.c b/stream/stream.c index c4b36dc436..5a0aa7d7dd 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -262,16 +262,6 @@ stream_t *open_output_stream(const char *filename, struct MPOpts *options) //=================== STREAMER ========================= -void stream_capture_do(stream_t *s) -{ - if (fwrite(s->buffer, s->buf_len, 1, s->capture_file) < 1) { - mp_tmsg(MSGT_GLOBAL, MSGL_ERR, "Error writing capture file: %s\n", - strerror(errno)); - fclose(s->capture_file); - s->capture_file = NULL; - } -} - int stream_read_internal(stream_t *s, void *buf, int len) { int orig_len = len; @@ -339,8 +329,6 @@ int stream_fill_buffer(stream_t *s){ s->buf_pos=0; s->buf_len=len; // printf("[%d]",len);fflush(stdout); - if (s->capture_file) - stream_capture_do(s); return len; } @@ -520,10 +508,6 @@ void free_stream(stream_t *s){ #ifdef CONFIG_STREAM_CACHE cache_uninit(s); #endif - if (s->capture_file) { - fclose(s->capture_file); - s->capture_file = NULL; - } if(s->close) s->close(s); if(s->fd>0){ diff --git a/stream/stream.h b/stream/stream.h index 828c364d40..0c17f02389 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -172,7 +172,6 @@ typedef struct stream { streaming_ctrl_t *streaming_ctrl; #endif unsigned char buffer[STREAM_BUFFER_SIZE>STREAM_MAX_SECTOR_SIZE?STREAM_BUFFER_SIZE:STREAM_MAX_SECTOR_SIZE]; - FILE *capture_file; } stream_t; #ifdef CONFIG_NETWORKING @@ -181,7 +180,6 @@ typedef struct stream { int stream_fill_buffer(stream_t *s); int stream_seek_long(stream_t *s, off_t pos); -void stream_capture_do(stream_t *s); #ifdef CONFIG_STREAM_CACHE int stream_enable_cache(stream_t *stream,int size,int min,int prefill); -- cgit v1.2.3