[totem-pl-parser] Fix parsing of 3gpp files



commit 3e2dc648a694b15352c2b7e54ff797986c238511
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Aug 26 14:11:49 2010 +0100

    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.

 plparse/tests/3gpp-file.mp4 |  Bin 0 -> 524288 bytes
 plparse/tests/Makefile.am   |    3 ++-
 plparse/tests/parser.c      |   12 ++++++++++++
 plparse/totem-pl-parser.c   |    1 +
 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
Binary files /dev/null and b/plparse/tests/3gpp-file.mp4 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),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]