# HG changeset patch
# User Diego 'Flameeyes' Pettenò <[EMAIL PROTECTED]>
# Date 1181318515 -7200
# Node ID 63b07f094b97a788065220b2077bc6b237e35b12
# Parent 82131abc655788bcc88f4b6613c1bc911ae1598d
More switches in parse_reference_atom.
diff -r 63b07f094b97a788065220b2077bc6b237e35b12 -r
82131abc655788bcc88f4b6613c1bc911ae1598d src/demuxers/demux_qt.c
--- a/src/demuxers/demux_qt.c Fri Jun 08 18:01:55 2007 +0200
+++ b/src/demuxers/demux_qt.c Fri Jun 08 17:57:30 2007 +0200
@@ -1540,9 +1540,7 @@ static qt_error parse_reference_atom (re
char *base_mrl) {
int i, j;
- unsigned int ref_atom_size = BE_32(&ref_atom[0]);
- qt_atom current_atom;
- unsigned int current_atom_size;
+ const unsigned int ref_atom_size = BE_32(&ref_atom[0]);
/* initialize reference atom */
ref->url = NULL;
@@ -1551,11 +1549,11 @@ static qt_error parse_reference_atom (re
/* traverse through the atom looking for the key atoms */
for (i = ATOM_PREAMBLE_SIZE; i < ref_atom_size - 4; i++) {
-
- current_atom_size = BE_32(&ref_atom[i - 4]);
- current_atom = BE_32(&ref_atom[i]);
-
- if (current_atom == RDRF_ATOM) {
+ const uint32_t current_atom_size = BE_32(&ref_atom[i - 4]);
+ const qt_atom current_atom = BE_32(&ref_atom[i]);
+
+ switch (current_atom) {
+ case RDRF_ATOM:
/* if the URL starts with "http://", copy it */
if (strncmp(&ref_atom[i + 16], "http://", 7) == 0
@@ -1584,17 +1582,17 @@ static qt_error parse_reference_atom (re
}
debug_atom_load(" qt rdrf URL reference:\n %s\n", ref->url);
-
- } else if (current_atom == RMDR_ATOM) {
-
+ break;
+
+ case RMDR_ATOM:
/* load the data rate */
ref->data_rate = BE_32(&ref_atom[i + 8]);
ref->data_rate *= 10;
debug_atom_load(" qt rmdr data rate = %"PRId64"\n", ref->data_rate);
-
- } else if (current_atom == RMVC_ATOM) {
-
+ break;
+
+ case RMVC_ATOM:
debug_atom_load(" qt rmvc atom\n");
/* search the rmvc atom for 'qtim'; 2 bytes will follow the qtim
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog