Merge pull request #445 from bnnm/fix

fix
This commit is contained in:
bnnm 2019-07-24 15:57:47 +02:00 committed by GitHub
commit 1b785021f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -2,11 +2,15 @@
#include "../streamfile.h"
#include <string.h>
#ifdef VGM_USE_FFMPEG
/**
* Transmogrifies custom Opus (no Ogg layer and custom packet headers) into is Xiph Opus, creating
* valid Ogg pages with single Opus packets.
* Uses an intermediate buffer to make full Ogg pages, since checksums are calculated with the whole page.
*
* Mostly as an experiment/demonstration, until some details are sorted out before adding actual libopus.
*
* Info, CRC and stuff:
* https://www.opus-codec.org/docs/
* https://tools.ietf.org/html/rfc7845.html
@ -512,8 +516,6 @@ static size_t get_xopus_packet_size(int packet, STREAMFILE * streamfile) {
}
#ifdef VGM_USE_FFMPEG
static size_t custom_opus_get_samples(off_t offset, size_t stream_size, STREAMFILE *streamFile, opus_type_t type) {
size_t num_samples = 0;
off_t end_offset = offset + stream_size;
@ -601,9 +603,11 @@ size_t ea_opus_get_encoder_delay(off_t offset, STREAMFILE *streamFile) {
}
/* ******************************************************* */
/* actual FFmpeg only-code starts here (the above is universal enough but no point to compile) */
//#ifdef VGM_USE_FFMPEG
static ffmpeg_codec_data * init_ffmpeg_custom_opus_config(STREAMFILE *streamFile, off_t start_offset, size_t data_size, opus_config *cfg, opus_type_t type) {
ffmpeg_codec_data * ffmpeg_data = NULL;
STREAMFILE *temp_streamFile = NULL;

View File

@ -1,3 +1,4 @@
#include <math.h>
#include "meta.h"
#include "../layout/layout.h"
#include "../coding/coding.h"