[vlc-commits] [Git][videolan/vlc][master] access: dvdnav: check directory content on probing

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon May 22 06:41:36 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
163b4240 by Ilkka Ollakka at 2023-05-21T10:26:43+00:00
access: dvdnav: check directory content on probing

If we probe directory, check if it contains VIDEO_TS/VIDEO_TS.IFO before
letting dvdnav to probe, otherwise dvdnav will give error on that and it
shows unnecessary error to end user.

- - - - -


1 changed file:

- modules/access/dvdnav.c


Changes:

=====================================
modules/access/dvdnav.c
=====================================
@@ -1739,9 +1739,29 @@ static int ProbeDVD( const char *psz_name )
          goto bailout;
     if( !S_ISREG( stat_info.st_mode ) )
     {
-        if( S_ISDIR( stat_info.st_mode ) || S_ISBLK( stat_info.st_mode ) )
+        if( S_ISBLK( stat_info.st_mode ) )
+        {
             ret = VLC_SUCCESS; /* Let dvdnav_open() do the probing */
-        goto bailout;
+            goto bailout;
+        }
+        if( S_ISDIR( stat_info.st_mode ) )
+        {
+            // If we have directory, check if VIDEO_TS/VIDEO_TS.IFO exists, as
+            // dvdnav will check and fail without it
+            char *video_ts_location;
+            if( asprintf( &video_ts_location, "%s/VIDEO_TS/VIDEO_TS.IFO", psz_name) == -1 )
+            {
+                ret = VLC_EGENERIC;
+                goto bailout;
+            }
+
+            if( access(video_ts_location, R_OK) == -1 )
+                ret = VLC_EGENERIC;
+            else
+                ret = VLC_SUCCESS;
+            free( video_ts_location );
+            goto bailout;
+        }
     }
 
     /* ISO 9660 volume descriptor */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/163b42403aa935a63e0d0c39390df490c676b0cb

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/163b42403aa935a63e0d0c39390df490c676b0cb
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list