mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-26 17:38:15 +02:00
2017-03-16 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in 'lib/rdaudioconvert.cpp' that caused conversions from MPEG Layer 3 VBR data to be truncated when no end point was specified. * Fixed a bug in 'web/rdxport/import.cpp' that caused the end marker to be positioned incorrectly when importing MPEG Layer 3 VBR files.
This commit is contained in:
parent
301fbf42aa
commit
5b5800d27f
@ -15642,3 +15642,10 @@
|
|||||||
* Fixed typos in 'rlm/rlm_tagstation.c' that caused failure to
|
* Fixed typos in 'rlm/rlm_tagstation.c' that caused failure to
|
||||||
read the 'CategoryAdvertisements=' and 'CategoryPromotions='
|
read the 'CategoryAdvertisements=' and 'CategoryPromotions='
|
||||||
directives.
|
directives.
|
||||||
|
2017-03-16 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Fixed a bug in 'lib/rdaudioconvert.cpp' that caused conversions
|
||||||
|
from MPEG Layer 3 VBR data to be truncated when no end point
|
||||||
|
was specified.
|
||||||
|
* Fixed a bug in 'web/rdxport/import.cpp' that caused the
|
||||||
|
end marker to be positioned incorrectly when importing MPEG
|
||||||
|
Layer 3 VBR files.
|
||||||
|
@ -558,7 +558,7 @@ RDAudioConvert::ErrorCode RDAudioConvert::Stage1Mpeg(const QString &dstfile,
|
|||||||
unsigned char buffer[STAGE1BUFSIZE];
|
unsigned char buffer[STAGE1BUFSIZE];
|
||||||
float sf_buffer[1152*2];
|
float sf_buffer[1152*2];
|
||||||
sf_count_t start=0;
|
sf_count_t start=0;
|
||||||
sf_count_t end=wave->getSampleLength();
|
int64_t end=-1;
|
||||||
sf_count_t frames=0;
|
sf_count_t frames=0;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -607,13 +607,13 @@ RDAudioConvert::ErrorCode RDAudioConvert::Stage1Mpeg(const QString &dstfile,
|
|||||||
|
|
||||||
int thiserr=mad_frame_decode(&mad_frame,&mad_stream);
|
int thiserr=mad_frame_decode(&mad_frame,&mad_stream);
|
||||||
if(thiserr!=0) {
|
if(thiserr!=0) {
|
||||||
if(!MAD_RECOVERABLE(mad_stream.error))
|
if(!MAD_RECOVERABLE(mad_stream.error)) {
|
||||||
break;
|
break;
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//printf("decoding...\n");
|
|
||||||
mad_synth_frame(&mad_synth,&mad_frame);
|
mad_synth_frame(&mad_synth,&mad_frame);
|
||||||
for(int i=0;i<mad_synth.pcm.length;i++) {
|
for(int i=0;i<mad_synth.pcm.length;i++) {
|
||||||
for(int j=0;j<mad_synth.pcm.channels;j++) {
|
for(int j=0;j<mad_synth.pcm.channels;j++) {
|
||||||
@ -622,7 +622,7 @@ RDAudioConvert::ErrorCode RDAudioConvert::Stage1Mpeg(const QString &dstfile,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(frames>=start) {
|
if(frames>=start) {
|
||||||
if((frames+mad_synth.pcm.length)<end) { // Write entire buffer
|
if((end<0)||((frames+mad_synth.pcm.length)<end)) { // Write full buffer
|
||||||
UpdatePeak(sf_buffer,mad_synth.pcm.length*wave->getChannels());
|
UpdatePeak(sf_buffer,mad_synth.pcm.length*wave->getChannels());
|
||||||
sf_writef_float(sf_dst,sf_buffer,mad_synth.pcm.length);
|
sf_writef_float(sf_dst,sf_buffer,mad_synth.pcm.length);
|
||||||
}
|
}
|
||||||
@ -659,9 +659,9 @@ RDAudioConvert::ErrorCode RDAudioConvert::Stage1Mpeg(const QString &dstfile,
|
|||||||
// Prevent buffer overflow on malformed files.
|
// Prevent buffer overflow on malformed files.
|
||||||
// The amount checked for should match the maximum amount that may be read
|
// The amount checked for should match the maximum amount that may be read
|
||||||
// by the next top-of-loop wave->readWave call.
|
// by the next top-of-loop wave->readWave call.
|
||||||
if(left_over + fsize + 1 > STAGE1BUFSIZE)
|
if(left_over + fsize + 1 > STAGE1BUFSIZE) {
|
||||||
return RDAudioConvert::ErrorFormatError;
|
return RDAudioConvert::ErrorFormatError;
|
||||||
|
}
|
||||||
memmove(buffer,mad_stream.next_frame,left_over);
|
memmove(buffer,mad_stream.next_frame,left_over);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
void Xport::Import()
|
void Xport::Import()
|
||||||
{
|
{
|
||||||
unsigned length_deviation=0;
|
unsigned length_deviation=0;
|
||||||
unsigned msecs;
|
unsigned msecs=0;
|
||||||
int resp_code=0;
|
int resp_code=0;
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -159,7 +159,6 @@ void Xport::Import()
|
|||||||
delete wave;
|
delete wave;
|
||||||
XmlExit("Format Not Supported",415);
|
XmlExit("Format Not Supported",415);
|
||||||
}
|
}
|
||||||
msecs=wave->getExtTimeLength();
|
|
||||||
delete wave;
|
delete wave;
|
||||||
RDAudioConvert *conv=new RDAudioConvert(xport_config->stationName());
|
RDAudioConvert *conv=new RDAudioConvert(xport_config->stationName());
|
||||||
conv->setSourceFile(filename);
|
conv->setSourceFile(filename);
|
||||||
@ -168,6 +167,15 @@ void Xport::Import()
|
|||||||
RDAudioConvert::ErrorCode conv_err=conv->convert();
|
RDAudioConvert::ErrorCode conv_err=conv->convert();
|
||||||
switch(conv_err) {
|
switch(conv_err) {
|
||||||
case RDAudioConvert::ErrorOk:
|
case RDAudioConvert::ErrorOk:
|
||||||
|
wave=new RDWaveFile(RDCut::pathName(cartnum,cutnum));
|
||||||
|
if(wave->openWave()) {
|
||||||
|
msecs=wave->getExtTimeLength();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
delete wave;
|
||||||
|
XmlExit("Unable to access imported file",500);
|
||||||
|
}
|
||||||
|
delete wave;
|
||||||
cut->checkInRecording(xport_config->stationName(),settings,msecs);
|
cut->checkInRecording(xport_config->stationName(),settings,msecs);
|
||||||
if(use_metadata>0) {
|
if(use_metadata>0) {
|
||||||
cart->setMetadata(conv->sourceWaveData());
|
cart->setMetadata(conv->sourceWaveData());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user