mirror of
https://github.com/vgmstream/vgmstream.git
synced 2025-01-02 00:23:09 +01:00
29 lines
786 B
C
29 lines
786 B
C
|
#include "coding.h"
|
||
|
#include "ffmpeg_decoder_utils.h"
|
||
|
|
||
|
#ifdef VGM_USE_FFMPEG
|
||
|
|
||
|
/**
|
||
|
* Standard read mode: virtual values are 1:1 but inside a portion of the streamfile (between real_start and real_size).
|
||
|
*/
|
||
|
|
||
|
|
||
|
int ffmpeg_custom_read_standard(ffmpeg_codec_data *data, uint8_t *buf, int buf_size) {
|
||
|
size_t bytes = read_streamfile(buf, data->real_offset, buf_size, data->streamfile);
|
||
|
data->real_offset += bytes;
|
||
|
|
||
|
return bytes;
|
||
|
}
|
||
|
|
||
|
int64_t ffmpeg_custom_seek_standard(ffmpeg_codec_data *data, int64_t virtual_offset) {
|
||
|
data->real_offset = data->real_start + (virtual_offset - data->header_size);
|
||
|
return virtual_offset;
|
||
|
}
|
||
|
|
||
|
int64_t ffmpeg_custom_size_standard(ffmpeg_codec_data *data) {
|
||
|
return data->real_size + data->header_size;
|
||
|
}
|
||
|
|
||
|
|
||
|
#endif
|