[vlc-commits] dvdread: use designated initializer for callback structure

Alexandre Janniaux git at videolan.org
Fri Mar 19 14:26:31 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Mar 15 18:15:35 2021 +0100| [c3cb5de81f2eb9f38ccba60435bbb8f3bfcc898b] | committer: Alexandre Janniaux

dvdread: use designated initializer for callback structure

So that we don't give an uninitialized field if the structure expands in
dvdread.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3cb5de81f2eb9f38ccba60435bbb8f3bfcc898b
---

 modules/access/dvdread.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index bd5cb84b3a..4f1c8ae9f7 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -205,8 +205,7 @@ static int Open( vlc_object_t *p_this )
     /* Open dvdread */
     const char *psz_path = ToLocale( psz_file );
 #if DVDREAD_VERSION >= DVDREAD_VERSION_CODE(6, 1, 0)
-    dvd_logger_cb cbs;
-    cbs.pf_log = DvdReadLog;
+    dvd_logger_cb cbs = { .pf_log = DvdReadLog };
     dvd_reader_t *p_dvdread = DVDOpen2( p_demux, &cbs, psz_path );
 #else
     dvd_reader_t *p_dvdread = DVDOpen( psz_path );



More information about the vlc-commits mailing list