dvdbackup does not build with libdvdread 6.1.0

Bug #1869226 reported by Emanuel Haupt
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dvdbackup
New
Undecided
Unassigned

Bug Description

The following commit to libdvdread breaks dvdbackup 0.4.2:

https://code.videolan.org/videolan/libdvdread/-/commit/cabd80c8350bc22a9c705363565e8631ecb39234

----
dvdbackup.c:1212:31: error: no member named 'file' in 'ifo_handle_t'
        size = DVDFileSize(ifo_file->file) * DVD_VIDEO_LB_LEN;
                           ~~~~~~~~ ^
dvdbackup.c:1223:24: error: no member named 'file' in 'ifo_handle_t'
        DVDFileSeek(ifo_file->file, 0);
                    ~~~~~~~~ ^
dvdbackup.c:1225:29: error: no member named 'file' in 'ifo_handle_t'
        if (DVDReadBytes(ifo_file->file,buffer,size) != size) {
                         ~~~~~~~~ ^
1 warning and 3 errors generated.
----

This is because the dvd_file_t *file pointer is now private.

Revision history for this message
Felix Palmen (zirias) wrote :

Suggest this patch, seems to work for me:

-----
--- src/dvdbackup.c.orig 2012-06-24 01:10:29 UTC
+++ src/dvdbackup.c
@@ -1132,7 +1132,7 @@ static int DVDCopyIfoBup(dvd_reader_t* dvd, title_set_
  int size;

  /* DVD handler */
- ifo_handle_t* ifo_file = NULL;
+ dvd_file_t* ifo_file = NULL;

  if (title_set_info->number_of_title_sets + 1 < title_set) {
@@ -1181,7 +1181,7 @@ static int DVDCopyIfoBup(dvd_reader_t* dvd, title_set_
  if ((streamout_ifo = open(targetname_ifo, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) {
   fprintf(stderr, _("Error creating %s\n"), targetname_ifo);
   perror(PACKAGE);
- ifoClose(ifo_file);
+ DVDCloseFile(ifo_file);
   free(buffer);
   close(streamout_ifo);
   close(streamout_bup);
@@ -1191,7 +1191,7 @@ static int DVDCopyIfoBup(dvd_reader_t* dvd, title_set_
  if ((streamout_bup = open(targetname_bup, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == -1) {
   fprintf(stderr, _("Error creating %s\n"), targetname_bup);
   perror(PACKAGE);
- ifoClose(ifo_file);
+ DVDCloseFile(ifo_file);
   free(buffer);
   close(streamout_ifo);
   close(streamout_bup);
@@ -1200,31 +1200,31 @@ static int DVDCopyIfoBup(dvd_reader_t* dvd, title_set_

  /* Copy VIDEO_TS.IFO, since it's a small file try to copy it in one shot */

- if ((ifo_file = ifoOpen(dvd, title_set))== 0) {
+ if ((ifo_file = DVDOpenFile(dvd, title_set, DVD_READ_INFO_FILE))== 0) {
   fprintf(stderr, _("Failed opening IFO for title set %d\n"), title_set);
- ifoClose(ifo_file);
+ DVDCloseFile(ifo_file);
   free(buffer);
   close(streamout_ifo);
   close(streamout_bup);
   return 1;
  }

- size = DVDFileSize(ifo_file->file) * DVD_VIDEO_LB_LEN;
+ size = DVDFileSize(ifo_file) * DVD_VIDEO_LB_LEN;

  if ((buffer = (unsigned char *)malloc(size * sizeof(unsigned char))) == NULL) {
   perror(PACKAGE);
- ifoClose(ifo_file);
+ DVDCloseFile(ifo_file);
   free(buffer);
   close(streamout_ifo);
   close(streamout_bup);
   return 1;
  }

- DVDFileSeek(ifo_file->file, 0);
+ DVDFileSeek(ifo_file, 0);

- if (DVDReadBytes(ifo_file->file,buffer,size) != size) {
+ if (DVDReadBytes(ifo_file,buffer,size) != size) {
   fprintf(stderr, _("Error reading IFO for title set %d\n"), title_set);
- ifoClose(ifo_file);
+ DVDCloseFile(ifo_file);
   free(buffer);
   close(streamout_ifo);
   close(streamout_bup);
@@ -1234,7 +1234,7 @@ static int DVDCopyIfoBup(dvd_reader_t* dvd, title_set_

  if (write(streamout_ifo,buffer,size) != size) {
   fprintf(stderr, _("Error writing %s\n"),targetname_ifo);
- ifoClose(ifo_file);
+ DVDCloseFile(ifo_file);
   free(buffer);
   close(streamout_ifo);
   close(streamout_bup);
@@ -1243,7 +1243,7 @@ static int DVDCopyIfoBup(dvd_reader_t* dvd, title_set_

  if (write(streamout_bup,buffer,size) != size) {
   fprintf(stderr, _("Error writing %s\n"),targetname_bup);
- ifoClose(ifo_file);
+ DVDCloseFile(ifo_file);
   free(buffer);
   close(streamout_ifo);
   close(streamout_bup);
-----

Revision history for this message
Emanuel Haupt (ehaupt) wrote :

Thank you Felix, your patch works for me.

Revision history for this message
S Barnes (ironictoo) wrote :

I have attached a patch file, as my copy paste of the above didn't work (it looked like the line numbers were different, but my patch is identical, so maybe something else) and I had to apply the edits by hand. But once applied the patch works great. For the uninitiated run: 'git apply newlibdvdread.patch'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.