Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 208691 | Differences between
and this patch

Collapse All | Expand All

(-)src/dvdread/dvd_reader.c (-1 / +23 lines)
Lines 1017-1022 int32_t DVDFileSeek( dvd_file_t *dvd_fi Link Here
1017
  return offset;
1017
  return offset;
1018
}
1018
}
1019
1019
1020
int32_t DVDFileSeekForce( dvd_file_t *dvd_file, int offset, int force_size )
1021
{
1022
  /* Check arguments. */
1023
  if( dvd_file == NULL || offset < 0 )
1024
    return -1;
1025
1026
  if( dvd_file->dvd->isImageFile ) {
1027
    if( force_size < 0 )
1028
      force_size = (offset - 1) / DVD_VIDEO_LB_LEN + 1;
1029
    if( dvd_file->filesize < force_size ) {
1030
      dvd_file->filesize = force_size;
1031
      fprintf(stderr, "libdvdread: Ignored UDF provided size of file.\n");
1032
    }
1033
  }
1034
1035
  if( offset > dvd_file->filesize * DVD_VIDEO_LB_LEN ) {
1036
    return -1;
1037
  }
1038
  dvd_file->seek_pos = (uint32_t) offset;
1039
  return offset;
1040
}
1041
1020
ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
1042
ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
1021
{
1043
{
1022
   unsigned char *secbuf_base, *secbuf;
1044
   unsigned char *secbuf_base, *secbuf;
Lines 1057-1063 ssize_t DVDReadBytes( dvd_file_t *dvd_fi Link Here
1057
    memcpy( data, &(secbuf[ seek_byte ]), byte_size );
1057
    memcpy( data, &(secbuf[ seek_byte ]), byte_size );
1058
    free( secbuf_base );
1058
    free( secbuf_base );
1059
    dvd_file->seek_pos += byte_size;
1059
    DVDFileSeekForce(dvd_file, dvd_file->seek_pos + byte_size, -1);
1060
    return byte_size;
1060
    return byte_size;
1061
}
1061
}
(-)src/dvdread/dvd_reader.h (+2 lines)
Lines 169-174 ssize_t DVDReadBlocks( dvd_file_t *, int Link Here
169
 */
169
 */
170
int32_t DVDFileSeek( dvd_file_t *, int32_t );
170
int32_t DVDFileSeek( dvd_file_t *, int32_t );
171
171
172
int32_t DVDFileSeekForce( dvd_file_t *, int, int );
173
172
/**
174
/**
173
 * Reads the given number of bytes from the file.  This call can only be used
175
 * Reads the given number of bytes from the file.  This call can only be used
174
 * on the information files, and may not be used for reading from a VOB.  This
176
 * on the information files, and may not be used for reading from a VOB.  This
(-)src/dvdread/ifo_read.c (-1 / +5 lines)
Lines 93-98 static inline int DVDFileSeek_( dvd_file Link Here
93
  return (DVDFileSeek(dvd_file, (int)offset) == (int)offset);
93
  return (DVDFileSeek(dvd_file, (int)offset) == (int)offset);
94
}
94
}
95
95
96
static inline int DVDFileSeekForce_( dvd_file_t *dvd_file, uint32_t offset, int force_size ) {
97
  return (DVDFileSeekForce(dvd_file, (int)offset, force_size) == (int)offset);
98
}
99
96
100
97
ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
101
ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) {
98
  ifo_handle_t *ifofile;
102
  ifo_handle_t *ifofile;
Lines 1507-1513 static int ifoRead_VOBU_ADMAP_internal(i Link Here
1507
  unsigned int i;
1507
  unsigned int i;
1508
  int info_length;
1508
  int info_length;
1509
1509
1510
  if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
1510
  if(!DVDFileSeekForce_(ifofile->file, sector * DVD_BLOCK_LEN, sector))
1511
    return 0;
1511
    return 0;
1512
1512
1513
  if(!(DVDReadBytes(ifofile->file, vobu_admap, VOBU_ADMAP_SIZE)))
1513
  if(!(DVDReadBytes(ifofile->file, vobu_admap, VOBU_ADMAP_SIZE)))

Return to bug 208691