diff options
author | wm4 <wm4@nowhere> | 2013-07-12 22:05:43 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-12 22:16:26 +0200 |
commit | 5c1b8d4aa1d35c806159cb22d52449774eb5186e (patch) | |
tree | d8df9313f536368772762c9011ea497682766ed4 /stream/stream.h | |
parent | cb45b1c65b2fe4644342db202e5f7b9fb64f2488 (diff) | |
download | mpv-5c1b8d4aa1d35c806159cb22d52449774eb5186e.tar.bz2 mpv-5c1b8d4aa1d35c806159cb22d52449774eb5186e.tar.xz |
stream: don't require streams to set a type
Set the type only for streams that have special treatment in other parts
of the code.
Diffstat (limited to 'stream/stream.h')
-rw-r--r-- | stream/stream.h | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/stream/stream.h b/stream/stream.h index 0d7e02ed4d..b80f31c44f 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -34,25 +34,17 @@ #define O_BINARY 0 #endif -#define STREAMTYPE_DUMMY -1 // for placeholders, when the actual reading is handled in the demuxer -#define STREAMTYPE_FILE 0 // read from seekable file -#define STREAMTYPE_VCD 1 // raw mode-2 CDROM reading, 2324 bytes/sector -#define STREAMTYPE_DVD 3 // libdvdread -#define STREAMTYPE_MEMORY 4 -#define STREAMTYPE_PLAYLIST 6 // FIXME!!! same as STREAMTYPE_FILE now -#define STREAMTYPE_CDDA 10 // raw audio CD reader -#define STREAMTYPE_SMB 11 // smb:// url, using libsmbclient (samba) -#define STREAMTYPE_VCDBINCUE 12 // vcd directly from bin/cue files -#define STREAMTYPE_DVB 13 -#define STREAMTYPE_VSTREAM 14 -#define STREAMTYPE_SDP 15 -#define STREAMTYPE_PVR 16 -#define STREAMTYPE_TV 17 -#define STREAMTYPE_MF 18 -#define STREAMTYPE_RADIO 19 -#define STREAMTYPE_BLURAY 20 -#define STREAMTYPE_AVDEVICE 21 -#define STREAMTYPE_CACHE 22 +enum streamtype { + STREAMTYPE_GENERIC = 0, + STREAMTYPE_FILE, + STREAMTYPE_RADIO, + STREAMTYPE_DVB, + STREAMTYPE_DVD, + STREAMTYPE_PVR, + STREAMTYPE_TV, + STREAMTYPE_MF, + STREAMTYPE_AVDEVICE, +}; #define STREAM_BUFFER_SIZE 2048 #define STREAM_MAX_SECTOR_SIZE (8 * 1024) @@ -143,8 +135,8 @@ typedef struct stream { void (*close)(struct stream *s); int fd; // file descriptor, see man open(2) - int type; // see STREAMTYPE_* - int uncached_type; // like (uncached_stream ? uncached_stream->type : type) + enum streamtype type; // see STREAMTYPE_* + enum streamtype uncached_type; // if stream is cache, type of wrapped str. int flags; // MP_STREAM_SEEK_* or'ed flags int sector_size; // sector size (seek will be aligned on this size if non 0) int read_chunk; // maximum amount of data to read at once to limit latency |