summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2010-08-26 14:11:49 +0100
committerBastien Nocera <hadess@hadess.net>2010-08-26 14:11:49 +0100
commit3e2dc648a694b15352c2b7e54ff797986c238511 (patch)
tree9f5ab2d1ff0ef6940173a374b12d13263b161dac
parenta0824aa8e003b62b8976d2cb683c0cae09d2d6a2 (diff)
downloadtotem-pl-parser-3e2dc648a694b15352c2b7e54ff797986c238511.tar.gz
Fix parsing of 3gpp files
3GPP files with a .mp4 suffix would have been ignored by the parser when they should actually be marked as "unhandled" by the parser, and handled by the player instead. Fixed Debian bug #594359.
-rw-r--r--plparse/tests/3gpp-file.mp4bin0 -> 524288 bytes
-rw-r--r--plparse/tests/Makefile.am3
-rw-r--r--plparse/tests/parser.c12
-rw-r--r--plparse/totem-pl-parser.c1
4 files changed, 15 insertions, 1 deletions
diff --git a/plparse/tests/3gpp-file.mp4 b/plparse/tests/3gpp-file.mp4
new file mode 100644
index 0000000..e750cd0
--- /dev/null
+++ b/plparse/tests/3gpp-file.mp4
Binary files differ
diff --git a/plparse/tests/Makefile.am b/plparse/tests/Makefile.am
index 1c8b5b4..ce0fdb1 100644
--- a/plparse/tests/Makefile.am
+++ b/plparse/tests/Makefile.am
@@ -59,4 +59,5 @@ EXTRA_DIST = \
playlist.xspf \
new-lastfm-output.xspf \
old-lastfm-output.xspf \
- separator.m3u
+ separator.m3u \
+ 3gpp-file.mp4
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index 097ce10..9bfbfdb 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -531,6 +531,17 @@ test_parsing_404_error (void)
}
static void
+test_parsing_3gpp_not_ignored (void)
+{
+ char *uri;
+
+ uri = get_relative_uri (TEST_SRCDIR "3gpp-file.mp4");
+ g_test_bug ("594359@bugs.debian.org");
+ g_assert (simple_parser_test (uri) == TOTEM_PL_PARSER_RESULT_UNHANDLED);
+ g_free (uri);
+}
+
+static void
test_parsing_xml_head_comments (void)
{
char *uri;
@@ -763,6 +774,7 @@ main (int argc, char *argv[])
g_test_add_func ("/parser/parsing/nonexistent_files", test_parsing_nonexistent_files);
g_test_add_func ("/parser/parsing/broken_asx", test_parsing_broken_asx);
g_test_add_func ("/parser/parsing/404_error", test_parsing_404_error);
+ g_test_add_func ("/parser/parsing/3gpp_not_ignored", test_parsing_3gpp_not_ignored);
g_test_add_func ("/parser/parsing/out_of_order_asx", test_parsing_out_of_order_asx);
g_test_add_func ("/parser/parsing/xml_head_comments", test_parsing_xml_head_comments);
g_test_add_func ("/parser/parsing/xml_comment_whitespace", test_parsing_xml_comment_whitespace);
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index e96f1d4..4308aa6 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -232,6 +232,7 @@ static PlaylistTypes dual_types[] = {
PLAYLIST_TYPE2 ("video/x-ms-wmv", totem_pl_parser_add_asf, totem_pl_parser_is_asf),
PLAYLIST_TYPE2 ("video/quicktime", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
PLAYLIST_TYPE2 ("video/mp4", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
+ PLAYLIST_TYPE2 ("video/3gpp", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
PLAYLIST_TYPE2 ("application/x-quicktime-media-link", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
PLAYLIST_TYPE2 ("application/x-quicktimeplayer", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),
PLAYLIST_TYPE2 ("application/xml", totem_pl_parser_add_xml_feed, totem_pl_parser_is_xml_feed),