summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/memmem.c2
-rw-r--r--src/demuxers/demux_ts.c14
-rw-r--r--src/input/input_dvd.c9
-rw-r--r--src/input/input_file.c25
-rw-r--r--src/xine-engine/xine.c14
-rw-r--r--src/xine-engine/xine_internal.h4
6 files changed, 34 insertions, 34 deletions
diff --git a/lib/memmem.c b/lib/memmem.c
index 1cbe629bd..75a989d94 100644
--- a/lib/memmem.c
+++ b/lib/memmem.c
@@ -21,7 +21,7 @@
#include <string.h>
/* Return the first occurrence of NEEDLE in HAYSTACK. */
-void *xine_internal_memmem (const void *haystack, size_t haystack_len,
+void *xine_private_memmem (const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len)
{
const char *begin;
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 2b3f77d11..07f466adb 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -341,6 +341,8 @@ typedef struct {
int32_t npkt_read;
uint8_t buf[BUF_SIZE]; /* == PKT_SIZE * NPKT_PER_READ */
+
+ int numPreview;
} demux_ts_t;
@@ -895,6 +897,16 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts,
m->buf->decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE;
m->buf->decoder_info[2] = SPU_DVD_SUBTYPE_PACKAGE;
}
+ else {
+ if (this->numPreview<5)
+ ++this->numPreview;
+ if ( this->numPreview==1 )
+ m->buf->decoder_flags=BUF_FLAG_HEADER | BUF_FLAG_FRAME_END;
+ else if ( this->numPreview<5 )
+ m->buf->decoder_flags=BUF_FLAG_PREVIEW;
+ else
+ m->buf->decoder_flags=BUF_FLAG_FRAME_END;
+ }
m->buf->pts = m->pts;
m->buf->decoder_info[0] = 1;
@@ -2256,6 +2268,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
/* dvb */
this->event_queue = xine_event_new_queue (this->stream);
+ this->numPreview=0;
+
return &this->demux_plugin;
}
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 40464c02a..c55ff8726 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -1489,12 +1489,14 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
trace_print("Called\n");
/* we already checked the "dvd:/" MRL before */
- locator = this->mrl + (sizeof("dvd:") - 1);
+ locator = strdup (this->mrl + (sizeof("dvd:") - 1));
/* FIXME: call a generic xine-lib MRL parser here to pre-parse
* the MRL for ?title=<title>&part=<part> stuff and to expand
* escaped characters properly */
-
+
+ _x_mrl_unescape (locator);
+
this->mode = dvd_parse_mrl(this, &locator, &title_part);
if (this->mode == MODE_FAIL) {
@@ -1503,8 +1505,11 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
_x_message(this->stream, XINE_MSG_READ_ERROR,
/* FIXME: see FIXME in dvd_parse_try_open() */
(strlen(locator) && !(locator[0] == '/' && locator[1] == '\0')) ? locator : class->dvd_device, NULL);
+ free (locator);
return 0;
}
+
+ free (locator);
dvdnav_get_title_string(this->dvdnav, &this->dvd_name);
if(this->dvd_name)
diff --git a/src/input/input_file.c b/src/input/input_file.c
index dd67d06ed..91513194c 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -327,31 +327,8 @@ static void file_plugin_dispose (input_plugin_t *this_gen ) {
}
static char *decode_uri (char *uri) {
-
- int len = strlen (uri);
- int i;
-
uri = strdup(uri);
-
- for (i=0; i<len; i++) {
-
- if ( (uri[i]=='%') && (i<(len-2)) ) {
-
- int c;
-
- if ( sscanf (&uri[i+1], "%02x", &c) == 1) {
-
- uri[i]= (char) c;
-
- memmove (uri+i+1, uri+i+3, len-i-3);
-
- len-=2;
- }
- }
- }
-
- uri[len] = 0;
-
+ _x_mrl_unescape (uri);
return uri;
}
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index ce2af52fa..e44419ecf 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -714,7 +714,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
return stream;
}
-static void mrl_unescape(char *mrl) {
+void _x_mrl_unescape(char *mrl) {
int i, len = strlen(mrl);
for (i = 0; i < len; i++) {
@@ -862,7 +862,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
memcpy(demux_name, tmp, strlen(tmp));
demux_name[strlen(tmp)] = '\0';
}
- mrl_unescape(demux_name);
+ _x_mrl_unescape(demux_name);
if (!(stream->demux_plugin = _x_find_demux_plugin_by_name(stream, demux_name, stream->input_plugin))) {
xine_log(stream->xine, XINE_LOG_MSG, _("xine: specified demuxer %s failed to start\n"), demux_name);
stream->err = XINE_ERROR_NO_DEMUX_PLUGIN;
@@ -936,7 +936,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
memcpy(demux_name, tmp, strlen(tmp));
demux_name[strlen(tmp)] = '\0';
}
- mrl_unescape(demux_name);
+ _x_mrl_unescape(demux_name);
if (!(stream->demux_plugin = _x_find_demux_plugin_last_probe(stream, demux_name, stream->input_plugin))) {
xine_log(stream->xine, XINE_LOG_MSG, _("xine: last_probed demuxer %s failed to start\n"), demux_name);
stream->err = XINE_ERROR_NO_DEMUX_PLUGIN;
@@ -1023,7 +1023,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
memcpy(volume, tmp, strlen(tmp));
volume[strlen(tmp)] = '\0';
}
- mrl_unescape(volume);
+ _x_mrl_unescape(volume);
xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME, atoi(volume));
free(volume);
} else {
@@ -1048,7 +1048,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
memcpy(compression, tmp, strlen(tmp));
compression[strlen(tmp)] = '\0';
}
- mrl_unescape(compression);
+ _x_mrl_unescape(compression);
xine_set_param(stream, XINE_PARAM_AUDIO_COMPR_LEVEL, atoi(compression));
free(compression);
} else {
@@ -1073,7 +1073,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
memcpy(subtitle_mrl, tmp, strlen(tmp));
subtitle_mrl[strlen(tmp)] = '\0';
}
- mrl_unescape(subtitle_mrl);
+ _x_mrl_unescape(subtitle_mrl);
stream->slave = xine_stream_new (stream->xine, NULL, stream->video_out );
stream->slave_affection = XINE_MASTER_SLAVE_PLAY | XINE_MASTER_SLAVE_STOP;
if( xine_open( stream->slave, subtitle_mrl ) ) {
@@ -1108,7 +1108,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
memcpy(config_entry, tmp, strlen(tmp));
config_entry[strlen(tmp)] = '\0';
}
- mrl_unescape(config_entry);
+ _x_mrl_unescape(config_entry);
retval = _x_config_change_opt(stream->xine->config, config_entry);
if (retval <= 0) {
if (retval == 0) {
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index fc142d44b..8f3e6e71f 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -464,6 +464,10 @@ void _x_demux_send_mrl_reference (xine_stream_t *stream, int alternative,
const char *mrl, const char *title,
int start_time, int duration) XINE_PROTECTED;
+/*
+ * MRL escaped-character decoding (overwrites the source string)
+ */
+void _x_mrl_unescape(char *mrl) XINE_PROTECTED;
/*
* plugin_loader functions