diff options
author | wm4 <wm4@nowhere> | 2012-10-13 17:09:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-14 22:26:41 +0200 |
commit | a19f197cb14a0ceec4bc1fe977502b8f8ab8f94e (patch) | |
tree | b4de459e097301d352b6a46e5086c51dfd682231 /stream/stream.c | |
parent | 9dfcd3e9a24a2d88578909233e2db24863f27b89 (diff) | |
download | mpv-a19f197cb14a0ceec4bc1fe977502b8f8ab8f94e.tar.bz2 mpv-a19f197cb14a0ceec4bc1fe977502b8f8ab8f94e.tar.xz |
core: show quvi page title in window title, clean up libquvi handling
Clean up handling of libquvi (which resolves URLs of streaming sites
into URLs to the actual media playable by mpv). Move the code out of
open.c to quvi.c, and invoke it explicitly from mplayer.c, instead of
trying to resolve every filename passed to open_stream().
This allows easily passing metadata from the quvi context to the
frontend. Expose QUVIPROP_PAGETITLE as "media-title" property, and use
that instead of "filename" for the mplayer window title. (For YouTube,
this is the video title.) It's cleaner too.
Handle a potential reliability issue: check quvi_getprop return values.
Since open.c contains barely anything but the open_stream() stub, move
that to stream.c and delete open.c.
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c index d7500cc790..ab0039e581 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -53,6 +53,12 @@ #include "cache2.h" +/// We keep these 2 for the gui atm, but they will be removed. +int vcd_track=0; +char* cdrom_device=NULL; +char* dvd_device=NULL; +int dvd_title=0; + struct input_ctx; static int (*stream_check_interrupt_cb)(struct input_ctx *ctx, int time); static struct input_ctx *stream_check_interrupt_ctx; @@ -199,6 +205,12 @@ stream_t *open_stream_full(const char *filename, int mode, stream_t* s; char *redirected_url = NULL; + int dummy; + if (!file_format) + file_format = &dummy; + + *file_format = DEMUXER_TYPE_UNKNOWN; + for(i = 0 ; auto_open_streams[i] ; i++) { sinfo = auto_open_streams[i]; if(!sinfo->protocols) { @@ -235,6 +247,18 @@ stream_t *open_stream_full(const char *filename, int mode, return NULL; } +stream_t* open_stream(const char *filename, struct MPOpts *options, + int *file_format) +{ + +if(!filename) { + mp_msg(MSGT_OPEN,MSGL_ERR,"NULL filename, report this bug\n"); + return NULL; +} + + return open_stream_full(filename,STREAM_READ,options,file_format); +} + stream_t *open_output_stream(const char *filename, struct MPOpts *options) { int file_format; //unused |