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:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
|
#include <MediaIO.h>
|
||||||
|
|
||||||
#include "APEReader.h"
|
#include "APEReader.h"
|
||||||
#include "MACLib.h"
|
#include "MACLib.h"
|
||||||
@@ -216,6 +217,17 @@ TAPEReader::Sniff(int32* oStreamCount)
|
|||||||
if (mSrcPIO == NULL)
|
if (mSrcPIO == NULL)
|
||||||
return B_ERROR;
|
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;
|
int nFunctionRetVal = ERROR_SUCCESS;
|
||||||
mPositionBridgeIO.SetPositionIO(mSrcPIO);
|
mPositionBridgeIO.SetPositionIO(mSrcPIO);
|
||||||
|
|
||||||
|
|||||||
@@ -282,4 +282,4 @@ int CAPEHeader::AnalyzeOld(APE_FILE_INFO * pInfo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user