summaryrefslogtreecommitdiff
path: root/src/demuxers
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2009-08-26 15:45:59 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2009-08-26 15:45:59 +0100
commit556f8d0d0799bd05f38cfb454fdb80de85dd2f7c (patch)
treef36b5415d765427ead674dae5d4d61c077b3a638 /src/demuxers
parent8e334af88b6ac33adc19f6f274595b7e239684f5 (diff)
downloadxine-lib-556f8d0d0799bd05f38cfb454fdb80de85dd2f7c.tar.gz
xine-lib-556f8d0d0799bd05f38cfb454fdb80de85dd2f7c.tar.bz2
Add a user agent & protocol hack to allow viewing of Apple film trailers.
Diffstat (limited to 'src/demuxers')
-rw-r--r--src/demuxers/demux_qt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 5aba5b479..2039e54d3 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -1620,6 +1620,7 @@ static qt_error parse_reference_atom (reference_t *ref,
if (current_atom == RDRF_ATOM) {
size_t string_size = _X_BE_32(&ref_atom[i + 12]);
size_t url_offset = 0;
+ int http = 0;
if (string_size >= current_atom_size || string_size >= ref_atom_size - i)
return QT_NOT_A_VALID_FILE;
@@ -1628,7 +1629,11 @@ static qt_error parse_reference_atom (reference_t *ref,
if ( memcmp(&ref_atom[i + 16], "http://", 7) &&
memcmp(&ref_atom[i + 16], "rtsp://", 7) &&
base_mrl )
- url_offset = strlen(base_mrl);
+ {
+ /* We need a "qt" prefix hack for Apple trailers */
+ http = !strncasecmp (base_mrl, "http://", 7);
+ url_offset = strlen(base_mrl) + 2 * http;
+ }
if (url_offset >= 0x80000000)
return QT_NOT_A_VALID_FILE;
@@ -1638,7 +1643,7 @@ static qt_error parse_reference_atom (reference_t *ref,
ref->url = xine_xmalloc(string_size + 1);
if ( url_offset )
- strcpy(ref->url, base_mrl);
+ sprintf (ref->url, "%s%s", http ? "qt" : "", base_mrl);
memcpy(ref->url + url_offset, &ref_atom[i + 16], _X_BE_32(&ref_atom[i + 12]));