diff options
author | wm4 <wm4@nowhere> | 2013-07-14 17:59:26 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-14 17:59:26 +0200 |
commit | e18ffd6b998858ca0797cb0ce4aabd4a509655dd (patch) | |
tree | 199bddd30923db1175a1331191eb86ba684e9e41 /stream/stream_vcd.c | |
parent | 3e7d483ac89289f613138002be2043ec5f479bb0 (diff) | |
parent | 5ead20bdb3328d199dad693039d18e7a05eb2465 (diff) | |
download | mpv-e18ffd6b998858ca0797cb0ce4aabd4a509655dd.tar.bz2 mpv-e18ffd6b998858ca0797cb0ce4aabd4a509655dd.tar.xz |
Merge branch 'remove_old_demuxers'
The merged branch doesn't actually just remove old demuxers, but also
includes a branch of cleanups and some refactoring.
Conflicts:
stream/stream.c
Diffstat (limited to 'stream/stream_vcd.c')
-rw-r--r-- | stream/stream_vcd.c | 54 |
1 files changed, 8 insertions, 46 deletions
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c index 422dea02cd..0fd2998c58 100644 --- a/stream/stream_vcd.c +++ b/stream/stream_vcd.c @@ -1,6 +1,8 @@ /* * This file is part of MPlayer. * + * Original author: Albeu + * * MPlayer is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -51,8 +53,6 @@ #include "vcd_read.h" #endif -#include "demux/demux.h" - extern char *cdrom_device; static struct stream_priv_s { @@ -94,46 +94,14 @@ static int seek(stream_t *s,int64_t newpos) { return 1; } -static int control(stream_t *stream, int cmd, void *arg) { - struct stream_priv_s *p = stream->priv; - switch(cmd) { - case STREAM_CTRL_GET_NUM_TITLES: - case STREAM_CTRL_GET_NUM_CHAPTERS: - { - mp_vcd_priv_t *vcd = vcd_read_toc(stream->fd); - if (!vcd) - break; - *(unsigned int *)arg = vcd_end_track(vcd); - return STREAM_OK; - } - case STREAM_CTRL_SEEK_TO_CHAPTER: - { - int r; - unsigned int track = *(unsigned int *)arg + 1; - mp_vcd_priv_t *vcd = vcd_read_toc(stream->fd); - if (!vcd) - break; - r = vcd_seek_to_track(vcd, track); - if (r >= 0) { - p->track = track; - return STREAM_OK; - } - break; - } - case STREAM_CTRL_GET_CURRENT_CHAPTER: - { - *(unsigned int *)arg = p->track - 1; - return STREAM_OK; - } - } - return STREAM_UNSUPPORTED; -} - static void close_s(stream_t *stream) { - free(stream->priv); + mp_vcd_priv_t *p = stream->priv; + close(p->fd); + free(p); } -static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { +static int open_s(stream_t *stream,int mode, void* opts) +{ struct stream_priv_s* p = opts; int ret,ret2,f,sect,tmp; mp_vcd_priv_t* vcd; @@ -221,8 +189,6 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { } #endif - stream->fd = f; - stream->type = STREAMTYPE_VCD; stream->sector_size = VCD_SECTOR_DATA; stream->start_pos=ret; stream->end_pos=ret2; @@ -230,19 +196,15 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) { stream->fill_buffer = fill_buffer; stream->seek = seek; - stream->control = control; stream->close = close_s; - *file_format = DEMUXER_TYPE_MPEG_PS; + stream->demuxer = "lavf"; // mpegps ( or "vcd"?) m_struct_free(&stream_opts,opts); return STREAM_OK; } const stream_info_t stream_info_vcd = { - "Video CD", "vcd", - "Albeu", - "based on the code from ???", open_s, { "vcd", NULL }, &stream_opts, |