ape_reader: Refuse to work on streaming data

* The MACLib try to find the APE_DESCRIPTOR in the whole file, this
will not work for streams with a finite size.
This commit is contained in:
Dario Casalinuovo
2016-06-23 00:38:33 +02:00
parent 59ff587d70
commit d56f636bf4
2 changed files with 13 additions and 1 deletions
@@ -4,6 +4,7 @@
#include <InterfaceDefs.h>
#include <MediaIO.h>
#include "APEReader.h"
#include "MACLib.h"
@@ -216,6 +217,17 @@ TAPEReader::Sniff(int32* oStreamCount)
if (mSrcPIO == NULL)
return B_ERROR;
BMediaIO* mediaIO = dynamic_cast<BMediaIO*>(Source());
if (mediaIO != NULL) {
int32 flags = 0;
mediaIO->GetFlags(&flags);
// This plugin doesn't support streamed data.
// The APEHeader::FindDescriptor function always
// analyze the whole file to find the APE_DESCRIPTOR.
if ((flags & B_MEDIA_STREAMING) == true)
return B_ERROR;
}
int nFunctionRetVal = ERROR_SUCCESS;
mPositionBridgeIO.SetPositionIO(mSrcPIO);
@@ -282,4 +282,4 @@ int CAPEHeader::AnalyzeOld(APE_FILE_INFO * pInfo)
}
return ERROR_SUCCESS;
}
}