summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.h1
-rw-r--r--stream/stream_rar.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/stream/stream.h b/stream/stream.h
index e4864f81b1..6d43f02a7c 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -100,6 +100,7 @@ enum stream_ctrl {
STREAM_CTRL_GET_DVD_INFO,
STREAM_CTRL_SET_CONTENTS,
STREAM_CTRL_GET_METADATA,
+ STREAM_CTRL_GET_BASE_FILENAME,
};
struct stream_lang_req {
diff --git a/stream/stream_rar.c b/stream/stream_rar.c
index d3ccfa3bf3..8402517dc3 100644
--- a/stream/stream_rar.c
+++ b/stream/stream_rar.c
@@ -75,6 +75,17 @@ static void rar_entry_close(stream_t *s)
RarFileDelete(rar_file);
}
+static int rar_entry_control(stream_t *s, int cmd, void *arg)
+{
+ rar_file_t *rar_file = s->priv;
+ switch (cmd) {
+ case STREAM_CTRL_GET_BASE_FILENAME:
+ *(char **)arg = talloc_strdup(NULL, rar_file->s->url);
+ return STREAM_OK;
+ }
+ return STREAM_UNSUPPORTED;
+}
+
static int rar_entry_open(stream_t *stream, int mode)
{
if (!strchr(stream->path, '|'))
@@ -123,6 +134,7 @@ static int rar_entry_open(stream_t *stream, int mode)
stream->fill_buffer = rar_entry_fill_buffer;
stream->seek = rar_entry_seek;
stream->close = rar_entry_close;
+ stream->control = rar_entry_control;
return STREAM_OK;
}