[libdvdnav-devel] [Git][videolan/libdvdnav][master] 3 commits: open_common: Remove useless error string assignment

Jean-Baptiste Kempf gitlab at videolan.org
Wed Mar 4 11:27:40 CET 2020



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdnav


Commits:
710bbbf2 by Hugo Beauzée-Luyssen at 2020-03-04T11:25:03+01:00
open_common: Remove useless error string assignment

Since we're about to release `this`, there's no way for the caller to
get the error string

- - - - -
3909fe9a by Hugo Beauzée-Luyssen at 2020-03-04T11:25:03+01:00
dvdnav: Add a dvdnav_version call

- - - - -
b6296aa5 by Hugo Beauzée-Luyssen at 2020-03-04T11:25:03+01:00
dvdnav: Don't unconditionally print the current version

Let users invoke dvdnav_version if they wish to know

- - - - -


2 changed files:

- src/dvdnav.c
- src/dvdnav/dvdnav.h


Changes:

=====================================
src/dvdnav.c
=====================================
@@ -153,8 +153,6 @@ static dvdnav_status_t dvdnav_open_common(dvdnav_t** dest, const char *path,
   struct timeval time;
 
   /* Create a new structure */
-  fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s\n", VERSION);
-
   (*dest) = NULL;
   this = (dvdnav_t*)calloc(1, sizeof(dvdnav_t));
   if(!this)
@@ -167,11 +165,9 @@ static dvdnav_status_t dvdnav_open_common(dvdnav_t** dest, const char *path,
   /* Initialise the VM */
   this->vm = vm_new_vm();
   if(!this->vm) {
-    printerr("Error initialising the DVD VM.");
     goto fail;
   }
   if(!vm_reset(this->vm, path, stream, stream_cb)) {
-    printerr("Error starting the VM / opening the DVD device.");
     goto fail;
   }
 
@@ -1291,3 +1287,7 @@ user_ops_t dvdnav_get_restrictions(dvdnav_t* this) {
 
   return ops.ops_struct;
 }
+
+const char* dvdnav_version(void) {
+    return VERSION;
+}


=====================================
src/dvdnav/dvdnav.h
=====================================
@@ -115,6 +115,7 @@ dvdnav_status_t dvdnav_path(dvdnav_t *self, const char **path);
  */
 const char* dvdnav_err_to_string(dvdnav_t *self);
 
+const char* dvdnav_version(void);
 
 /*********************************************************************
  * changing and reading DVD player characteristics                   *



View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/compare/de34b412ca0c040bac78cfd3448c99c9257b7422...b6296aa5b93338d711eab1b12a7c27b184c83866

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/compare/de34b412ca0c040bac78cfd3448c99c9257b7422...b6296aa5b93338d711eab1b12a7c27b184c83866
You're receiving this email because of your account on code.videolan.org.




More information about the libdvdnav-devel mailing list