File: 0035-taglib-Always-use-IOStream-to-read-the-media.patch

package info (click to toggle)
vlc 3.0.21-10
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 212,728 kB
  • sloc: ansic: 441,379; cpp: 110,628; objc: 36,394; sh: 6,947; makefile: 6,592; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 555; lex: 88; perl: 77; sed: 16
file content (87 lines) | stat: -rw-r--r-- 2,782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Mon, 16 Sep 2024 13:21:17 +0200
Subject: taglib: Always use IOStream to read the media

(cherry picked from commit 4bc7607f31f80264b5e61fbd187f2f8d2f3bb604) (edited)
edited:
- keep the support for taglib older than 1.11 which doesn't have the
  proper FileRef constructor to use it
- the aacresolver is only called for Taglib 1.11+ on 3.0
- 4.0 doesn't make a difference for UWP or regular Windows
---
 modules/meta_engine/taglib.cpp | 35 +++++++++--------------------------
 1 file changed, 9 insertions(+), 26 deletions(-)

diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp
index bec6838..adf3a24 100644
--- a/modules/meta_engine/taglib.cpp
+++ b/modules/meta_engine/taglib.cpp
@@ -891,15 +891,15 @@ static int ReadMeta( vlc_object_t* p_this)
     if( unlikely(psz_uri == NULL) )
         return VLC_ENOMEM;
 
-    char *psz_path = vlc_uri2path( psz_uri );
-#if VLC_WINSTORE_APP && TAGLIB_VERSION >= TAGLIB_VERSION_1_11
-    if( psz_path == NULL )
+    if( !b_extensions_registered )
     {
-        free( psz_uri );
-        return VLC_EGENERIC;
+#if TAGLIB_VERSION >= TAGLIB_VERSION_1_11
+        FileRef::addFileTypeResolver( &aacresolver );
+#endif
+        b_extensions_registered = true;
     }
-    free( psz_path );
 
+#if TAGLIB_VERSION >= TAGLIB_VERSION_1_11
     stream_t *p_stream = vlc_access_NewMRL( p_this, psz_uri );
     free( psz_uri );
     if( p_stream == NULL )
@@ -907,19 +907,12 @@ static int ReadMeta( vlc_object_t* p_this)
 
     VlcIostream s( p_stream );
     f = FileRef( &s );
-#else /* VLC_WINSTORE_APP */
+#else // !TAGLIB_VERSION_1_11
+    char *psz_path = vlc_uri2path( psz_uri );
     free( psz_uri );
     if( psz_path == NULL )
         return VLC_EGENERIC;
 
-    if( !b_extensions_registered )
-    {
-#if TAGLIB_VERSION >= TAGLIB_VERSION_1_11
-        FileRef::addFileTypeResolver( &aacresolver );
-#endif
-        b_extensions_registered = true;
-    }
-
 #if defined(_WIN32)
     wchar_t *wpath = ToWide( psz_path );
     if( wpath == NULL )
@@ -927,23 +920,13 @@ static int ReadMeta( vlc_object_t* p_this)
         free( psz_path );
         return VLC_EGENERIC;
     }
-#if TAGLIB_VERSION >= TAGLIB_VERSION_1_11
-    FileStream stream( wpath, true );
-    f = FileRef( &stream );
-#else /* TAGLIB_VERSION */
     f = FileRef( wpath );
-#endif /* TAGLIB_VERSION */
     free( wpath );
 #else /* _WIN32 */
-#if TAGLIB_VERSION >= TAGLIB_VERSION_1_11
-    FileStream stream( psz_path, true );
-    f = FileRef( &stream );
-#else /* TAGLIB_VERSION */
     f = FileRef( psz_path );
-#endif /* TAGLIB_VERSION */
 #endif /* _WIN32 */
     free( psz_path );
-#endif /* VLC_WINSTORE_APP */
+#endif // !TAGLIB_VERSION_1_11
 
     if( f.isNull() )
         return VLC_EGENERIC;