summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_asf.c146
-rw-r--r--src/demuxers/demux_ts.c6
-rw-r--r--src/input/input_dvb.c34
3 files changed, 90 insertions, 96 deletions
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index 447228fb0..742fa6541 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.c
@@ -1536,108 +1536,90 @@ static int demux_asf_parse_asx_references( demux_asf_t *this) {
ENTRYREF, MOREINFO, PARAM, REPEAT, TITLE
*/
- const char *version = xml_parser_get_property (xml_tree, "VERSION");
+ const char *base_href = NULL;
- if (version) {
- int version_major, version_minor = 0;
+ for (asx_entry = xml_tree->child; asx_entry; asx_entry = asx_entry->next)
+ {
+ const char *ref_base_href = base_href;
- if((sscanf (version, "%d.%d", &version_major, &version_minor) == 2 ||
- sscanf (version, "%d", &version_major) == 1) &&
- (version_major == 3 && version_minor == 0))
+ if (!strcasecmp (asx_entry->name, "ENTRY"))
{
- const char *base_href = NULL;
+ /* Attributes: CLIENTSKIP, SKIPIFREF
+ * Child elements: ABSTRACT, AUTHOR, BASE, COPYRIGHT, DURATION,
+ ENDMARKER, MOREINFO, PARAM, REF, STARTMARKER,
+ STARTTIME, TITLE
+ */
+ const char *href = NULL;
+ const char *title = NULL;
+ uint32_t start_time = (uint32_t)-1;
+ uint32_t duration = (uint32_t)-1;
- for (asx_entry = xml_tree->child; asx_entry; asx_entry = asx_entry->next)
+ for (asx_ref = asx_entry->child; asx_ref; asx_ref = asx_ref->next)
{
- const char *ref_base_href = base_href;
-
- if (!strcasecmp (asx_entry->name, "ENTRY"))
+ if (!strcasecmp(asx_ref->name, "REF"))
{
- /* Attributes: CLIENTSKIP, SKIPIFREF
- * Child elements: ABSTRACT, AUTHOR, BASE, COPYRIGHT, DURATION,
- ENDMARKER, MOREINFO, PARAM, REF, STARTMARKER,
- STARTTIME, TITLE
+ xml_node_t *asx_sub;
+ /* Attributes: HREF
+ * Child elements: DURATION, ENDMARKER, STARTMARKER, STARTTIME
+ */
+
+ /* FIXME: multiple REFs => alternative streams
+ * (and per-ref start times and durations?).
+ * Just the one title, though.
*/
- const char *href = NULL;
- const char *title = NULL;
- uint32_t start_time = (uint32_t)-1;
- uint32_t duration = (uint32_t)-1;
+ href = xml_parser_get_property (asx_ref, "HREF");
- for (asx_ref = asx_entry->child; asx_ref; asx_ref = asx_ref->next)
+ for (asx_sub = asx_ref->child; asx_sub; asx_sub = asx_sub->next)
{
- if (!strcasecmp(asx_ref->name, "REF"))
- {
- xml_node_t *asx_sub;
- /* Attributes: HREF
- * Child elements: DURATION, ENDMARKER, STARTMARKER, STARTTIME
- */
-
- /* FIXME: multiple REFs => alternative streams
- * (and per-ref start times and durations?).
- * Just the one title, though.
- */
- href = xml_parser_get_property (asx_ref, "HREF");
-
- for (asx_sub = asx_ref->child; asx_sub; asx_sub = asx_sub->next)
- {
- if (!strcasecmp (asx_sub->name, "STARTTIME"))
- start_time = asx_get_time_value (asx_sub);
- else if (!strcasecmp (asx_sub->name, "DURATION"))
- duration = asx_get_time_value (asx_sub);
- }
- }
-
- else if (!strcasecmp (asx_ref->name, "TITLE"))
- {
- if (!title)
- title = asx_ref->data;
- }
-
- else if (!strcasecmp (asx_ref->name, "STARTTIME"))
- {
- if (start_time == (uint32_t)-1)
- start_time = asx_get_time_value (asx_ref);
- }
-
- else if (!strcasecmp (asx_ref->name, "DURATION"))
- {
- if (duration == (uint32_t)-1)
- duration = asx_get_time_value (asx_ref);
- }
-
- else if (!strcasecmp (asx_ref->name, "BASE"))
- /* Attributes: HREF */
- ref_base_href = xml_parser_get_property (asx_entry, "HREF");
+ if (!strcasecmp (asx_sub->name, "STARTTIME"))
+ start_time = asx_get_time_value (asx_sub);
+ else if (!strcasecmp (asx_sub->name, "DURATION"))
+ duration = asx_get_time_value (asx_sub);
}
+ }
+
+ else if (!strcasecmp (asx_ref->name, "TITLE"))
+ {
+ if (!title)
+ title = asx_ref->data;
+ }
- /* FIXME: prepend ref_base_href to href */
- if (href && *href)
- _x_demux_send_mrl_reference (this->stream, 0, href, title,
- start_time == (uint32_t)-1 ? 0 : start_time,
- duration == (uint32_t)-1 ? -1 : duration);
+ else if (!strcasecmp (asx_ref->name, "STARTTIME"))
+ {
+ if (start_time == (uint32_t)-1)
+ start_time = asx_get_time_value (asx_ref);
}
- else if (!strcasecmp (asx_entry->name, "ENTRYREF"))
+ else if (!strcasecmp (asx_ref->name, "DURATION"))
{
- /* Attributes: HREF, CLIENTBIND */
- const char *href = xml_parser_get_property (asx_entry, "HREF");
- if (href && *href)
- _x_demux_send_mrl_reference (this->stream, 0, href, NULL, 0, -1);
+ if (duration == (uint32_t)-1)
+ duration = asx_get_time_value (asx_ref);
}
- else if (!strcasecmp (asx_entry->name, "BASE"))
+ else if (!strcasecmp (asx_ref->name, "BASE"))
/* Attributes: HREF */
- base_href = xml_parser_get_property (asx_entry, "HREF");
+ ref_base_href = xml_parser_get_property (asx_entry, "HREF");
}
+
+ /* FIXME: prepend ref_base_href to href */
+ if (href && *href)
+ _x_demux_send_mrl_reference (this->stream, 0, href, title,
+ start_time == (uint32_t)-1 ? 0 : start_time,
+ duration == (uint32_t)-1 ? -1 : duration);
}
- else
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("demux_asf: Wrong ASX version: %s\n"), version);
-
+
+ else if (!strcasecmp (asx_entry->name, "ENTRYREF"))
+ {
+ /* Attributes: HREF, CLIENTBIND */
+ const char *href = xml_parser_get_property (asx_entry, "HREF");
+ if (href && *href)
+ _x_demux_send_mrl_reference (this->stream, 0, href, NULL, 0, -1);
+ }
+
+ else if (!strcasecmp (asx_entry->name, "BASE"))
+ /* Attributes: HREF */
+ base_href = xml_parser_get_property (asx_entry, "HREF");
}
- else
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_asf: Unable to find VERSION tag from ASX.\n");
}
else
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 52d6c7690..19f5c2d19 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -369,8 +369,8 @@ static void demux_ts_build_crc32_table(demux_ts_t*this) {
}
static uint32_t demux_ts_compute_crc32(demux_ts_t*this, uint8_t *data,
- uint32_t length, uint32_t crc32) {
- uint32_t i;
+ int32_t length, uint32_t crc32) {
+ int32_t i;
for(i = 0; i < length; i++) {
crc32 = (crc32 << 8) ^ this->crc32_table[(crc32 >> 24) ^ data[i]];
@@ -521,7 +521,7 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt,
unsigned char *pkt, unsigned int pusi) {
uint32_t table_id;
uint32_t section_syntax_indicator;
- uint32_t section_length;
+ int32_t section_length;
uint32_t transport_stream_id;
uint32_t version_number;
uint32_t current_next_indicator;
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 1715c5a2f..17c855062 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -3198,26 +3198,38 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
dvb_input_class_t *class = (dvb_input_class_t *) this_gen;
channel_t *channels=NULL;
char foobuffer[BUFSIZE];
- int ch, apch, num_channels;
+ int ch, apch, num_channels = 0;
int default_channel = -1;
xine_cfg_entry_t lastchannel_enable = {0};
xine_cfg_entry_t lastchannel;
- num_channels = 0;
+ /* need to probe card here to get fe_type to read in channels.conf */
+ tuner_t *tuner;
+ xine_cfg_entry_t adapter;
- if (!(channels = load_channels(class->xine, NULL, &num_channels, 0))) {
- static char *placefile = NULL;
+ xine_config_lookup_entry(class->xine, "media.dvb.adapter", &adapter);
+
+ if (!(tuner = tuner_init(class->xine,adapter.num_value))) {
+ xprintf(class->xine, XINE_VERBOSITY_LOG, _("input_dvb: cannot open dvb device\n"));
+ class->mrls[0]="Sorry, No DVB input device found.";
+ *num_files=1;
+ return class->mrls;
+ }
+
+ if (!(channels = load_channels(class->xine, NULL, &num_channels, tuner->feinfo.type))) {
/* channels.conf not found in .xine */
- class->mrls[0]="Sorry, no channels.conf found.";
- class->mrls[1]="Please run the scan utility from the DVB";
- class->mrls[2]="drivers apps package and place the file in";
- if (!placefile)
- asprintf (&placefile, "%s/"PACKAGE"/", xdgConfigHome(class->xine->basedir_handle));
- class->mrls[3]=placefile;
- *num_files=4;
+ class->mrls[0]="Sorry, No valid channels.conf found";
+ class->mrls[1]="for the selected DVB device.";
+ class->mrls[2]="Please run the dvbscan utility";
+ class->mrls[3]="from the dvb drivers apps package";
+ class->mrls[4]="and place the file in ~/.xine/";
+ *num_files=5;
+ tuner_dispose(tuner);
return class->mrls;
}
+ tuner_dispose(tuner);
+
if (xine_config_lookup_entry(class->xine, "media.dvb.remember_channel", &lastchannel_enable)
&& lastchannel_enable.num_value
&& xine_config_lookup_entry(class->xine, "media.dvb.last_channel", &lastchannel))