[totem-pl-parser] Possibly parse WMA files as ASF redirections



commit 016c792754027b63e65b759aaaf714c943c4834f
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 19 16:08:48 2011 +0000

    Possibly parse WMA files as ASF redirections
    
    https://bugzilla.gnome.org/show_bug.cgi?id=639958

 plparse/tests/Makefile.am                       |    3 ++-
 plparse/tests/WMA9.1_98_quality_48khz_vbr_s.wma |    3 +++
 plparse/tests/parser.c                          |   13 +++++++++++++
 plparse/totem-pl-parser.c                       |    1 +
 4 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/plparse/tests/Makefile.am b/plparse/tests/Makefile.am
index 58b7e06..5368b83 100644
--- a/plparse/tests/Makefile.am
+++ b/plparse/tests/Makefile.am
@@ -65,4 +65,5 @@ EXTRA_DIST =			\
 	audio.php		\
 	big5.smi		\
 	O_G_Money_Snoop_Dogg.m3u \
-	empty-asx.asx
+	empty-asx.asx		\
+	WMA9.1_98_quality_48khz_vbr_s.wma
diff --git a/plparse/tests/WMA9.1_98_quality_48khz_vbr_s.wma b/plparse/tests/WMA9.1_98_quality_48khz_vbr_s.wma
new file mode 100644
index 0000000..e6ac18f
--- /dev/null
+++ b/plparse/tests/WMA9.1_98_quality_48khz_vbr_s.wma
@@ -0,0 +1,3 @@
+[Reference]
+Ref1=http://195.134.224.231/wma/WMA9.1_98_quality_48khz_vbr_s.wma?MSWMExt=.asf
+Ref2=http://195.134.224.231:80/wma/WMA9.1_98_quality_48khz_vbr_s.wma?MSWMExt=.asf
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index 64ab3f6..ec0ab5d 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -686,6 +686,18 @@ test_parsing_not_asx_playlist (void)
 }
 
 static void
+test_parsing_wma_asf (void)
+{
+	char *uri;
+	g_test_bug ("639958");
+	/* File from https://bugzilla.gnome.org/show_bug.cgi?id=639958#c5 */
+	uri = get_relative_uri (TEST_SRCDIR "WMA9.1_98_quality_48khz_vbr_s.wma");
+	g_assert (simple_parser_test (uri) == TOTEM_PL_PARSER_RESULT_SUCCESS);
+	g_assert_cmpstr (parser_test_get_entry_field (uri, TOTEM_PL_PARSER_FIELD_URI), ==, "mmsh://195.134.224.231/wma/WMA9.1_98_quality_48khz_vbr_s.wma?MSWMExt=.asf");
+	g_free (uri);
+}
+
+static void
 test_parsing_not_really_php (void)
 {
 	char *uri;
@@ -955,6 +967,7 @@ main (int argc, char *argv[])
 		g_test_add_func ("/parser/parsing/empty-asx.asx", test_empty_asx);
 		g_test_add_func ("/parser/parsing/dir_recurse", test_directory_recurse);
 		g_test_add_func ("/parser/parsing/async_signal_order", test_async_parsing_signal_order);
+		g_test_add_func ("/parser/parsing/wma_asf", test_parsing_wma_asf);
 
 		return g_test_run ();
 	}
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index 106e819..eef200d 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -231,6 +231,7 @@ static PlaylistTypes dual_types[] = {
 	PLAYLIST_TYPE2 ("audio/x-ms-asx", totem_pl_parser_add_asx, totem_pl_parser_is_asx),
 	PLAYLIST_TYPE2 ("video/x-ms-asf", totem_pl_parser_add_asf, totem_pl_parser_is_asf),
 	PLAYLIST_TYPE2 ("video/x-ms-wmv", totem_pl_parser_add_asf, totem_pl_parser_is_asf),
+	PLAYLIST_TYPE2 ("audio/x-ms-wma", 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 ("application/x-quicktime-media-link", totem_pl_parser_add_quicktime, totem_pl_parser_is_quicktime),



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