Cleaned up most of the warnings, eliminated use of deprecated APIs, and fixed the hotkeys crashing.
parent
51cc8a69e5
commit
ec0e45381e
|
@ -161,19 +161,19 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
|
|
||||||
p = [NSOpenPanel openPanel];
|
p = [NSOpenPanel openPanel];
|
||||||
|
|
||||||
|
[p setAllowedFileTypes:[playlistLoader acceptableFileTypes]];
|
||||||
[p setCanChooseDirectories:YES];
|
[p setCanChooseDirectories:YES];
|
||||||
[p setAllowsMultipleSelection:YES];
|
[p setAllowsMultipleSelection:YES];
|
||||||
|
[p setResolvesAliases:YES];
|
||||||
|
|
||||||
[p beginSheetForDirectory:nil file:nil types:[playlistLoader acceptableFileTypes] modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:) contextInfo:NULL];
|
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
|
||||||
}
|
if ( result == NSFileHandlingPanelOKButton ) {
|
||||||
|
[playlistLoader willInsertURLs:[p URLs] origin:URLOriginInternal];
|
||||||
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
[playlistLoader didInsertURLs:[playlistLoader addURLs:[p URLs] sort:YES] origin:URLOriginInternal];
|
||||||
{
|
} else {
|
||||||
if (returnCode == NSOKButton)
|
[p close];
|
||||||
{
|
|
||||||
[playlistLoader willInsertURLs:[panel URLs] origin:URLOriginInternal];
|
|
||||||
[playlistLoader didInsertURLs:[playlistLoader addURLs:[panel URLs] sort:YES] origin:URLOriginInternal];
|
|
||||||
}
|
}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)savePlaylist:(id)sender
|
- (IBAction)savePlaylist:(id)sender
|
||||||
|
@ -182,16 +182,13 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
|
|
||||||
p = [NSSavePanel savePanel];
|
p = [NSSavePanel savePanel];
|
||||||
|
|
||||||
[p setAllowedFileTypes:[playlistLoader acceptablePlaylistTypes]];
|
[p beginSheetModalForWindow:mainWindow completionHandler:^(NSInteger result) {
|
||||||
[p beginSheetForDirectory:nil file:nil modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:NULL];
|
if ( result == NSFileHandlingPanelOKButton ) {
|
||||||
}
|
[playlistLoader save:[[p URL] path]];
|
||||||
|
} else {
|
||||||
- (void)savePanelDidEnd:(NSSavePanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
|
[p close];
|
||||||
{
|
|
||||||
if (returnCode == NSOKButton)
|
|
||||||
{
|
|
||||||
[playlistLoader save:[panel filename]];
|
|
||||||
}
|
}
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)openURL:(id)sender
|
- (IBAction)openURL:(id)sender
|
||||||
|
@ -265,7 +262,7 @@ increase/decrease as long as the user holds the left/right, plus/minus button */
|
||||||
|
|
||||||
if ([fileManager fileExistsAtPath: folder] == NO)
|
if ([fileManager fileExistsAtPath: folder] == NO)
|
||||||
{
|
{
|
||||||
[fileManager createDirectoryAtPath: folder attributes: nil];
|
[fileManager createDirectoryAtPath: folder withIntermediateDirectories:NO attributes:nil error:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *fileName = @"Default.m3u";
|
NSString *fileName = @"Default.m3u";
|
||||||
|
|
|
@ -17,19 +17,19 @@
|
||||||
{
|
{
|
||||||
case NX_KEYTYPE_PLAY:
|
case NX_KEYTYPE_PLAY:
|
||||||
if( state == 0 )
|
if( state == 0 )
|
||||||
[[self delegate] clickPlay]; //Play pressed and released
|
[(AppController *)[self delegate] clickPlay]; //Play pressed and released
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NX_KEYTYPE_NEXT:
|
case NX_KEYTYPE_NEXT:
|
||||||
case NX_KEYTYPE_FAST:
|
case NX_KEYTYPE_FAST:
|
||||||
if( state == 0 )
|
if( state == 0 )
|
||||||
[[self delegate] clickNext]; //Next pressed and released
|
[(AppController *)[self delegate] clickNext]; //Next pressed and released
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NX_KEYTYPE_PREVIOUS:
|
case NX_KEYTYPE_PREVIOUS:
|
||||||
case NX_KEYTYPE_REWIND:
|
case NX_KEYTYPE_REWIND:
|
||||||
if( state == 0 )
|
if( state == 0 )
|
||||||
[[self delegate] clickPrev]; //Previous pressed and released
|
[(AppController *)[self delegate] clickPrev]; //Previous pressed and released
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ NSString *CogPlaybackDidStopNotficiation = @"CogPlaybackDidStopNotficiation";
|
||||||
- (IBAction)play:(id)sender
|
- (IBAction)play:(id)sender
|
||||||
{
|
{
|
||||||
if ([playlistView selectedRow] == -1)
|
if ([playlistView selectedRow] == -1)
|
||||||
[playlistView selectRow:0 byExtendingSelection:NO];
|
[playlistView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
|
||||||
|
|
||||||
if ([playlistView selectedRow] > -1)
|
if ([playlistView selectedRow] > -1)
|
||||||
[self playEntryAtIndex:[playlistView selectedRow]];
|
[self playEntryAtIndex:[playlistView selectedRow]];
|
||||||
|
|
|
@ -54,8 +54,6 @@
|
||||||
- (void)setNextStream:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary*)rgi;
|
- (void)setNextStream:(NSURL *)url withUserInfo:(id)userInfo withRGInfo:(NSDictionary*)rgi;
|
||||||
- (void)resetNextStreams;
|
- (void)resetNextStreams;
|
||||||
|
|
||||||
- (void)setRGInfo:(NSDictionary *)rgi;
|
|
||||||
|
|
||||||
+ (NSArray *)fileTypes;
|
+ (NSArray *)fileTypes;
|
||||||
+ (NSArray *)schemes;
|
+ (NSArray *)schemes;
|
||||||
+ (NSArray *)containerTypes;
|
+ (NSArray *)containerTypes;
|
||||||
|
|
|
@ -17,12 +17,12 @@ void PrintStreamDesc (AudioStreamBasicDescription *inDesc)
|
||||||
printf ("- - - - - - - - - - - - - - - - - - - -\n");
|
printf ("- - - - - - - - - - - - - - - - - - - -\n");
|
||||||
printf (" Sample Rate:%f\n", inDesc->mSampleRate);
|
printf (" Sample Rate:%f\n", inDesc->mSampleRate);
|
||||||
printf (" Format ID:%s\n", (char*)&inDesc->mFormatID);
|
printf (" Format ID:%s\n", (char*)&inDesc->mFormatID);
|
||||||
printf (" Format Flags:%lX\n", inDesc->mFormatFlags);
|
printf (" Format Flags:%X\n", inDesc->mFormatFlags);
|
||||||
printf (" Bytes per Packet:%ld\n", inDesc->mBytesPerPacket);
|
printf (" Bytes per Packet:%d\n", inDesc->mBytesPerPacket);
|
||||||
printf (" Frames per Packet:%ld\n", inDesc->mFramesPerPacket);
|
printf (" Frames per Packet:%d\n", inDesc->mFramesPerPacket);
|
||||||
printf (" Bytes per Frame:%ld\n", inDesc->mBytesPerFrame);
|
printf (" Bytes per Frame:%d\n", inDesc->mBytesPerFrame);
|
||||||
printf (" Channels per Frame:%ld\n", inDesc->mChannelsPerFrame);
|
printf (" Channels per Frame:%d\n", inDesc->mChannelsPerFrame);
|
||||||
printf (" Bits per Channel:%ld\n", inDesc->mBitsPerChannel);
|
printf (" Bits per Channel:%d\n", inDesc->mBitsPerChannel);
|
||||||
printf ("- - - - - - - - - - - - - - - - - - - -\n");
|
printf ("- - - - - - - - - - - - - - - - - - - -\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,9 +81,12 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
if (outputDevice == -1) {
|
if (outputDevice == -1) {
|
||||||
NSLog(@"DEVICE IS -1");
|
NSLog(@"DEVICE IS -1");
|
||||||
UInt32 size = sizeof(AudioDeviceID);
|
UInt32 size = sizeof(AudioDeviceID);
|
||||||
err = AudioHardwareGetProperty(kAudioHardwarePropertyDefaultOutputDevice,
|
AudioObjectPropertyAddress theAddress = {
|
||||||
&size,
|
.mSelector = kAudioHardwarePropertyDefaultOutputDevice,
|
||||||
&deviceID);
|
.mScope = kAudioObjectPropertyScopeGlobal,
|
||||||
|
.mElement = kAudioObjectPropertyElementMaster
|
||||||
|
};
|
||||||
|
err = AudioObjectGetPropertyData(kAudioObjectSystemObject, &theAddress, 0, NULL, &size, &deviceID);
|
||||||
|
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
NSLog(@"THERES NO DEFAULT OUTPUT DEVICE");
|
NSLog(@"THERES NO DEFAULT OUTPUT DEVICE");
|
||||||
|
@ -250,7 +253,7 @@ static OSStatus Sound_Renderer(void *inRefCon, AudioUnitRenderActionFlags *ioAc
|
||||||
|
|
||||||
- (void)resume
|
- (void)resume
|
||||||
{
|
{
|
||||||
OSStatus err = AudioOutputUnitStart(outputUnit);
|
AudioOutputUnitStart(outputUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
- (BOOL)seekable;
|
- (BOOL)seekable;
|
||||||
- (BOOL)seek:(long)position whence:(int)whence;
|
- (BOOL)seek:(long)position whence:(int)whence;
|
||||||
- (long)tell;
|
- (long)tell;
|
||||||
- (int)read:(void *)buffer amount:(int)amount; //reads UP TO amount, returns amount read.
|
- (long)read:(void *)buffer amount:(long)amount; //reads UP TO amount, returns amount read.
|
||||||
- (void)close;
|
- (void)close;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
@protocol CogMetadataWriter <NSObject>
|
@protocol CogMetadataWriter <NSObject>
|
||||||
//+ (NSArray *)fileTypes;
|
//+ (NSArray *)fileTypes;
|
||||||
//+ (NSArray *)mimeTypes;
|
//+ (NSArray *)mimeTypes;
|
||||||
+ (int)putMetadataInURL:(NSURL *)url;
|
+ (int)putMetadataInURL:(NSURL *)url tagData:(NSDictionary *)tagData;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@protocol CogPropertiesReader <NSObject>
|
@protocol CogPropertiesReader <NSObject>
|
||||||
|
|
|
@ -89,7 +89,7 @@ static PluginController *sharedPluginController = nil;
|
||||||
- (void)loadPluginsAtPath:(NSString *)path
|
- (void)loadPluginsAtPath:(NSString *)path
|
||||||
{
|
{
|
||||||
|
|
||||||
NSArray *dirContents = [[NSFileManager defaultManager] directoryContentsAtPath:path];
|
NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:path error:nil];
|
||||||
|
|
||||||
for (NSString *pname in dirContents)
|
for (NSString *pname in dirContents)
|
||||||
{
|
{
|
||||||
|
@ -272,5 +272,10 @@ static PluginController *sharedPluginController = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (int)putMetadataInURL:(NSURL *)url
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#import "AudioScrobblerClient.h"
|
#import "AudioScrobblerClient.h"
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#define kBufferSize 1024
|
#define kBufferSize 1024
|
||||||
#define kPortsToStep 5
|
#define kPortsToStep 5
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,13 +20,14 @@
|
||||||
|
|
||||||
- (void)updatePath
|
- (void)updatePath
|
||||||
{
|
{
|
||||||
NSArray *contents = [[[NSFileManager defaultManager] directoryContentsAtPath:[url path]] sortedArrayUsingSelector:@selector(finderCompare:)];
|
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:url includingPropertiesForKeys:[NSArray arrayWithObjects:NSURLNameKey, NSURLIsDirectoryKey, nil] options:(NSDirectoryEnumerationSkipsSubdirectoryDescendants | NSDirectoryEnumerationSkipsPackageDescendants | NSDirectoryEnumerationSkipsHiddenFiles) errorHandler:^BOOL(NSURL *url, NSError *error) {
|
||||||
|
return NO;
|
||||||
|
}];
|
||||||
NSMutableArray *fullPaths = [[NSMutableArray alloc] init];
|
NSMutableArray *fullPaths = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
for (NSString *s in contents)
|
for (NSURL * theUrl in enumerator)
|
||||||
{
|
{
|
||||||
if (![s hasPrefix:@"."])
|
[fullPaths addObject:[theUrl path]];
|
||||||
[fullPaths addObject:[[url path] stringByAppendingPathComponent: s]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[self processPaths: fullPaths];
|
[self processPaths: fullPaths];
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
- (IBAction)addToPlaylist:(id)sender;
|
- (IBAction)addToPlaylist:(id)sender;
|
||||||
- (IBAction)setAsPlaylist:(id)sender;
|
- (IBAction)setAsPlaylist:(id)sender;
|
||||||
|
- (IBAction)playPauseResume:(NSObject *)id;
|
||||||
- (IBAction)showEntryInFinder:(id)sender;
|
- (IBAction)showEntryInFinder:(id)sender;
|
||||||
- (IBAction)setAsRoot:(id)sender;
|
- (IBAction)setAsRoot:(id)sender;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
- (IBAction)addToPlaylist:(id)sender
|
- (IBAction)addToPlaylist:(id)sender
|
||||||
{
|
{
|
||||||
unsigned int index;
|
NSUInteger index;
|
||||||
NSIndexSet *selectedIndexes = [outlineView selectedRowIndexes];
|
NSIndexSet *selectedIndexes = [outlineView selectedRowIndexes];
|
||||||
NSMutableArray *urls = [[NSMutableArray alloc] init];
|
NSMutableArray *urls = [[NSMutableArray alloc] init];
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
- (IBAction)showEntryInFinder:(id)sender
|
- (IBAction)showEntryInFinder:(id)sender
|
||||||
{
|
{
|
||||||
unsigned int index;
|
NSUInteger index;
|
||||||
NSWorkspace* ws = [NSWorkspace sharedWorkspace];
|
NSWorkspace* ws = [NSWorkspace sharedWorkspace];
|
||||||
NSIndexSet *selectedIndexes = [outlineView selectedRowIndexes];
|
NSIndexSet *selectedIndexes = [outlineView selectedRowIndexes];
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
- (IBAction)setAsRoot:(id)sender
|
- (IBAction)setAsRoot:(id)sender
|
||||||
{
|
{
|
||||||
unsigned int index = [[outlineView selectedRowIndexes] firstIndex];
|
NSUInteger index = [[outlineView selectedRowIndexes] firstIndex];
|
||||||
|
|
||||||
if (index != NSNotFound)
|
if (index != NSNotFound)
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
change:(NSDictionary *)change
|
change:(NSDictionary *)change
|
||||||
context:(void *)context
|
context:(void *)context
|
||||||
{
|
{
|
||||||
NSLog([[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileTreeRootURL"]);
|
NSLog(@"File tree root URL: %@\n", [[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileTreeRootURL"]);
|
||||||
if ([keyPath isEqualToString:@"values.fileTreeRootURL"]) {
|
if ([keyPath isEqualToString:@"values.fileTreeRootURL"]) {
|
||||||
[self setRootURL:[NSURL URLWithString:[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileTreeRootURL"]]];
|
[self setRootURL:[NSURL URLWithString:[[[NSUserDefaultsController sharedUserDefaultsController] defaults] objectForKey:@"fileTreeRootURL"]]];
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#import "FileTreeController.h"
|
||||||
#import "FileTreeOutlineView.h"
|
#import "FileTreeOutlineView.h"
|
||||||
#import "FileTreeViewController.h"
|
#import "FileTreeViewController.h"
|
||||||
#import "PlaybackController.h"
|
#import "PlaybackController.h"
|
||||||
|
@ -30,13 +31,13 @@
|
||||||
|
|
||||||
if (modifiers == 0 && (c == NSEnterCharacter || c == NSCarriageReturnCharacter))
|
if (modifiers == 0 && (c == NSEnterCharacter || c == NSCarriageReturnCharacter))
|
||||||
{
|
{
|
||||||
[[self delegate] addToPlaylist:self];
|
[(FileTreeController *)[self delegate] addToPlaylist:self];
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (modifiers == 0 && c == ' ')
|
else if (modifiers == 0 && c == ' ')
|
||||||
{
|
{
|
||||||
[[self delegate] playPauseResume:self];
|
[(FileTreeController *)[self delegate] playPauseResume:self];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +67,7 @@
|
||||||
}
|
}
|
||||||
else if (!currentRowIsSelected)
|
else if (!currentRowIsSelected)
|
||||||
{
|
{
|
||||||
[self selectRow:iRow byExtendingSelection:NO];
|
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:iRow] byExtendingSelection:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
return contextMenu;
|
return contextMenu;
|
||||||
|
|
|
@ -263,7 +263,7 @@ void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx)
|
||||||
|
|
||||||
byteSwap(ctx->buf, 4);
|
byteSwap(ctx->buf, 4);
|
||||||
memcpy(digest, ctx->buf, 16);
|
memcpy(digest, ctx->buf, 16);
|
||||||
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
|
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
|
||||||
if(0 != ctx->internal_buf) {
|
if(0 != ctx->internal_buf) {
|
||||||
free(ctx->internal_buf);
|
free(ctx->internal_buf);
|
||||||
ctx->internal_buf = 0;
|
ctx->internal_buf = 0;
|
||||||
|
|
|
@ -434,7 +434,7 @@ FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type
|
||||||
{
|
{
|
||||||
FLAC__StreamMetadata *object;
|
FLAC__StreamMetadata *object;
|
||||||
|
|
||||||
if(type > FLAC__MAX_METADATA_TYPE_CODE)
|
if((unsigned int)type > FLAC__MAX_METADATA_TYPE_CODE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
object = (FLAC__StreamMetadata*)calloc(1, sizeof(FLAC__StreamMetadata));
|
object = (FLAC__StreamMetadata*)calloc(1, sizeof(FLAC__StreamMetadata));
|
||||||
|
|
|
@ -221,11 +221,11 @@ void Ay_Apu::run_until( blip_time_t final_end_time )
|
||||||
blip_time_t end_time = final_end_time;
|
blip_time_t end_time = final_end_time;
|
||||||
int const vol_mode = regs [0x08 + index];
|
int const vol_mode = regs [0x08 + index];
|
||||||
int const vol_mode_mask = type_ == Ay8914 ? 0x30 : 0x10;
|
int const vol_mode_mask = type_ == Ay8914 ? 0x30 : 0x10;
|
||||||
int volume = amp_table [vol_mode & 0x0F] >> half_vol + env_step_scale;
|
int volume = amp_table [vol_mode & 0x0F] >> (half_vol + env_step_scale);
|
||||||
int osc_env_pos = env_pos;
|
int osc_env_pos = env_pos;
|
||||||
if ( vol_mode & vol_mode_mask )
|
if ( vol_mode & vol_mode_mask )
|
||||||
{
|
{
|
||||||
volume = env_wave [osc_env_pos] >> half_vol + env_step_scale;
|
volume = env_wave [osc_env_pos] >> (half_vol + env_step_scale);
|
||||||
if ( type_ == Ay8914 ) volume >>= 3 - ( ( vol_mode & vol_mode_mask ) >> 4 );
|
if ( type_ == Ay8914 ) volume >>= 3 - ( ( vol_mode & vol_mode_mask ) >> 4 );
|
||||||
// use envelope only if it's a repeating wave or a ramp that hasn't finished
|
// use envelope only if it's a repeating wave or a ramp that hasn't finished
|
||||||
if ( !(regs [13] & 1) || osc_env_pos < -32 )
|
if ( !(regs [13] & 1) || osc_env_pos < -32 )
|
||||||
|
@ -374,7 +374,7 @@ void Ay_Apu::run_until( blip_time_t final_end_time )
|
||||||
// next envelope step
|
// next envelope step
|
||||||
if ( ++osc_env_pos >= 0 )
|
if ( ++osc_env_pos >= 0 )
|
||||||
osc_env_pos -= 32;
|
osc_env_pos -= 32;
|
||||||
volume = env_wave [osc_env_pos] >> half_vol + env_step_scale;
|
volume = env_wave [osc_env_pos] >> (half_vol + env_step_scale);
|
||||||
if ( type_ == Ay8914 ) volume >>= 3 - ( ( vol_mode & vol_mode_mask ) >> 4 );
|
if ( type_ == Ay8914 ) volume >>= 3 - ( ( vol_mode & vol_mode_mask ) >> 4 );
|
||||||
|
|
||||||
start_time = end_time;
|
start_time = end_time;
|
||||||
|
|
|
@ -255,7 +255,6 @@ void Dual_Resampler::mix_extra_mono( Stereo_Buffer& stereo_buf, dsample_t out_ [
|
||||||
typedef dsample_t stereo_dsample_t [2];
|
typedef dsample_t stereo_dsample_t [2];
|
||||||
stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count;
|
stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count;
|
||||||
int offset = -count;
|
int offset = -count;
|
||||||
int const gain = gain_;
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int s = BLIP_READER_READ_RAW( sn ) >> (blip_sample_bits - 16);
|
int s = BLIP_READER_READ_RAW( sn ) >> (blip_sample_bits - 16);
|
||||||
|
@ -290,7 +289,6 @@ void Dual_Resampler::mix_extra_stereo( Stereo_Buffer& stereo_buf, dsample_t out_
|
||||||
typedef dsample_t stereo_dsample_t [2];
|
typedef dsample_t stereo_dsample_t [2];
|
||||||
stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count;
|
stereo_dsample_t* BLARGG_RESTRICT out = (stereo_dsample_t*) out_ + count;
|
||||||
int offset = -count;
|
int offset = -count;
|
||||||
int const gain = gain_;
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
int sc = BLIP_READER_READ_RAW( snc ) >> (blip_sample_bits - 16);
|
int sc = BLIP_READER_READ_RAW( snc ) >> (blip_sample_bits - 16);
|
||||||
|
|
|
@ -1330,7 +1330,7 @@ blargg_err_t Vgm_Core::init_chips( double* rate, bool reinit )
|
||||||
}
|
}
|
||||||
if ( qsound_rate )
|
if ( qsound_rate )
|
||||||
{
|
{
|
||||||
double pcm_rate = (double)qsound_rate / 166.0;
|
/*double pcm_rate = (double)qsound_rate / 166.0;*/
|
||||||
if ( !reinit )
|
if ( !reinit )
|
||||||
{
|
{
|
||||||
int result = qsound[0].set_rate( qsound_rate );
|
int result = qsound[0].set_rate( qsound_rate );
|
||||||
|
|
|
@ -48,6 +48,7 @@ Unmapped registers:
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include "c140.h"
|
#include "c140.h"
|
||||||
|
|
||||||
|
#undef NULL
|
||||||
#define NULL ((void *)0)
|
#define NULL ((void *)0)
|
||||||
|
|
||||||
#define MAX_VOICE 24
|
#define MAX_VOICE 24
|
||||||
|
|
|
@ -3842,12 +3842,12 @@ void ym2610_update_one(void *chip, FMSAMPLE **buffer, int length)
|
||||||
/* Check YM2610B warning message */
|
/* Check YM2610B warning message */
|
||||||
if( FM_KEY_IS(&F2610->CH[0].SLOT[3]) )
|
if( FM_KEY_IS(&F2610->CH[0].SLOT[3]) )
|
||||||
{
|
{
|
||||||
LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,0));
|
/*LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,0));*/
|
||||||
FM_KEY_IS(&F2610->CH[3].SLOT[3]) = 0;
|
FM_KEY_IS(&F2610->CH[3].SLOT[3]) = 0;
|
||||||
}
|
}
|
||||||
if( FM_KEY_IS(&F2610->CH[3].SLOT[3]) )
|
if( FM_KEY_IS(&F2610->CH[3].SLOT[3]) )
|
||||||
{
|
{
|
||||||
LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,3));
|
/*LOG(LOG_WAR,(FM_MSG_YM2610B,F2610->OPN.ST.param,3));*/
|
||||||
FM_KEY_IS(&F2610->CH[3].SLOT[3]) = 0;
|
FM_KEY_IS(&F2610->CH[3].SLOT[3]) = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1497,8 +1497,8 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ /* set IRQ mask ,timer enable*/
|
{ /* set IRQ mask ,timer enable*/
|
||||||
UINT8 st1 = v&1;
|
/*UINT8 st1 = v&1;
|
||||||
UINT8 st2 = (v>>1)&1;
|
UINT8 st2 = (v>>1)&1;*/
|
||||||
|
|
||||||
/* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */
|
/* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */
|
||||||
OPL_STATUS_RESET(OPL, v & (0x78-0x08) );
|
OPL_STATUS_RESET(OPL, v & (0x78-0x08) );
|
||||||
|
@ -1526,8 +1526,8 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
|
||||||
{
|
{
|
||||||
if(OPL->keyboardhandler_w)
|
if(OPL->keyboardhandler_w)
|
||||||
OPL->keyboardhandler_w(OPL->keyboard_param,v);
|
OPL->keyboardhandler_w(OPL->keyboard_param,v);
|
||||||
else
|
/*else
|
||||||
logerror("Y8950: write unmapped KEYBOARD port\n");
|
logerror("Y8950: write unmapped KEYBOARD port\n");*/
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x07: /* DELTA-T control 1 : START,REC,MEMDATA,REPT,SPOFF,x,x,RST */
|
case 0x07: /* DELTA-T control 1 : START,REC,MEMDATA,REPT,SPOFF,x,x,RST */
|
||||||
|
@ -1561,7 +1561,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
|
||||||
case 0x15: /* DAC data high 8 bits (F7,F6...F2) */
|
case 0x15: /* DAC data high 8 bits (F7,F6...F2) */
|
||||||
case 0x16: /* DAC data low 2 bits (F1, F0 in bits 7,6) */
|
case 0x16: /* DAC data low 2 bits (F1, F0 in bits 7,6) */
|
||||||
case 0x17: /* DAC data shift (S2,S1,S0 in bits 2,1,0) */
|
case 0x17: /* DAC data shift (S2,S1,S0 in bits 2,1,0) */
|
||||||
logerror("FMOPL.C: DAC data register written, but not implemented reg=%02x val=%02x\n",r,v);
|
/*logerror("FMOPL.C: DAC data register written, but not implemented reg=%02x val=%02x\n",r,v);*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x18: /* I/O CTRL (Direction) */
|
case 0x18: /* I/O CTRL (Direction) */
|
||||||
|
@ -1578,7 +1578,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
logerror("FMOPL.C: write to unknown register: %02x\n",r);
|
/*logerror("FMOPL.C: write to unknown register: %02x\n",r);*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2095,8 +2095,8 @@ static unsigned char OPLRead(FM_OPL *OPL,int a)
|
||||||
{
|
{
|
||||||
if(OPL->keyboardhandler_r)
|
if(OPL->keyboardhandler_r)
|
||||||
return OPL->keyboardhandler_r(OPL->keyboard_param);
|
return OPL->keyboardhandler_r(OPL->keyboard_param);
|
||||||
else
|
/*else
|
||||||
logerror("Y8950: read unmapped KEYBOARD port\n");
|
logerror("Y8950: read unmapped KEYBOARD port\n");*/
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -2116,14 +2116,14 @@ static unsigned char OPLRead(FM_OPL *OPL,int a)
|
||||||
{
|
{
|
||||||
if(OPL->porthandler_r)
|
if(OPL->porthandler_r)
|
||||||
return OPL->porthandler_r(OPL->port_param);
|
return OPL->porthandler_r(OPL->port_param);
|
||||||
else
|
/*else
|
||||||
logerror("Y8950:read unmapped I/O port\n");
|
logerror("Y8950:read unmapped I/O port\n");*/
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case 0x1a: /* PCM-DATA */
|
case 0x1a: /* PCM-DATA */
|
||||||
if(OPL->type&OPL_TYPE_ADPCM)
|
if(OPL->type&OPL_TYPE_ADPCM)
|
||||||
{
|
{
|
||||||
logerror("Y8950 A/D convertion is accessed but not implemented !\n");
|
/*logerror("Y8950 A/D convertion is accessed but not implemented !\n");*/
|
||||||
return 0x80; /* 2's complement PCM data - result from A/D convertion */
|
return 0x80; /* 2's complement PCM data - result from A/D convertion */
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -303,7 +303,7 @@ INLINE void check_bounds( k053260_state *ic, int channel )
|
||||||
UINT32 channel_end = channel_start + ic->channels[channel].size - 1;
|
UINT32 channel_end = channel_start + ic->channels[channel].size - 1;
|
||||||
|
|
||||||
if ( channel_start > ic->rom_size ) {
|
if ( channel_start > ic->rom_size ) {
|
||||||
logerror("K53260: Attempting to start playing past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );
|
/*logerror("K53260: Attempting to start playing past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );*/
|
||||||
|
|
||||||
ic->channels[channel].play = 0;
|
ic->channels[channel].play = 0;
|
||||||
|
|
||||||
|
@ -311,11 +311,11 @@ INLINE void check_bounds( k053260_state *ic, int channel )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( channel_end > ic->rom_size ) {
|
if ( channel_end > ic->rom_size ) {
|
||||||
logerror("K53260: Attempting to play past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );
|
/*logerror("K53260: Attempting to play past the end of the ROM ( start = %06x, end = %06x ).\n", channel_start, channel_end );*/
|
||||||
|
|
||||||
ic->channels[channel].size = ic->rom_size - channel_start;
|
ic->channels[channel].size = ic->rom_size - channel_start;
|
||||||
}
|
}
|
||||||
if (LOG) logerror("K053260: Sample Start = %06x, Sample End = %06x, Sample rate = %04x, PPCM = %s\n", channel_start, channel_end, ic->channels[channel].rate, ic->channels[channel].ppcm ? "yes" : "no" );
|
/*if (LOG) logerror("K053260: Sample Start = %06x, Sample End = %06x, Sample rate = %04x, PPCM = %s\n", channel_start, channel_end, ic->channels[channel].rate, ic->channels[channel].ppcm ? "yes" : "no" );*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//WRITE8_DEVICE_HANDLER( k053260_w )
|
//WRITE8_DEVICE_HANDLER( k053260_w )
|
||||||
|
@ -328,7 +328,7 @@ void k053260_w(void *chip, offs_t offset, UINT8 data)
|
||||||
k053260_state *ic = (k053260_state *) chip;
|
k053260_state *ic = (k053260_state *) chip;
|
||||||
|
|
||||||
if ( r > 0x2f ) {
|
if ( r > 0x2f ) {
|
||||||
logerror("K053260: Writing past registers\n" );
|
/*logerror("K053260: Writing past registers\n" );*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,7 +462,7 @@ UINT8 k053260_r(void *chip, offs_t offset)
|
||||||
|
|
||||||
if ( offs > ic->rom_size ) {
|
if ( offs > ic->rom_size ) {
|
||||||
//logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine().describe_context(),offs,ic->rom_size );
|
//logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine().describe_context(),offs,ic->rom_size );
|
||||||
logerror("K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", offs,ic->rom_size );
|
/*logerror("K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", offs,ic->rom_size );*/
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ CHANNEL_DEBUG enables the following keys:
|
||||||
#endif
|
#endif
|
||||||
#include "k054539.h"
|
#include "k054539.h"
|
||||||
|
|
||||||
|
#undef NULL
|
||||||
#define NULL ((void *)0)
|
#define NULL ((void *)0)
|
||||||
|
|
||||||
#define CHANNEL_DEBUG 0
|
#define CHANNEL_DEBUG 0
|
||||||
|
@ -365,7 +366,7 @@ else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
LOG(("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch));
|
/*LOG(("Unknown sample type %x for channel %d\n", base2[0] & 0xc, ch));*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chan->pos = cur_pos;
|
chan->pos = cur_pos;
|
||||||
|
@ -664,7 +665,7 @@ UINT8 k054539_r(void *chip, offs_t offset)
|
||||||
case 0x22c:
|
case 0x22c:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(("K054539 read %03x\n", offset));
|
/*LOG(("K054539 read %03x\n", offset));*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return info->regs[offset];
|
return info->regs[offset];
|
||||||
|
|
|
@ -279,7 +279,6 @@ void device_reset_okim6258(void *chip)
|
||||||
void okim6258_set_divider(void *chip, int val)
|
void okim6258_set_divider(void *chip, int val)
|
||||||
{
|
{
|
||||||
okim6258_state *info = (okim6258_state *) chip;
|
okim6258_state *info = (okim6258_state *) chip;
|
||||||
int divider = dividers[val];
|
|
||||||
|
|
||||||
info->divider = dividers[val];
|
info->divider = dividers[val];
|
||||||
//stream_set_sample_rate(info->stream, info->master_clock / divider);
|
//stream_set_sample_rate(info->stream, info->master_clock / divider);
|
||||||
|
@ -402,7 +401,7 @@ void okim6258_ctrl_w(void *chip, offs_t offset, UINT8 data)
|
||||||
|
|
||||||
if (data & COMMAND_RECORD)
|
if (data & COMMAND_RECORD)
|
||||||
{
|
{
|
||||||
logerror("M6258: Record enabled\n");
|
/*logerror("M6258: Record enabled\n");*/
|
||||||
info->status |= STATUS_RECORDING;
|
info->status |= STATUS_RECORDING;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -605,7 +605,7 @@ void okim6295_write_command(okim6295_state *info, UINT8 data)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",device->tag(),info->command);
|
//logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",device->tag(),info->command);
|
||||||
logerror("OKIM6295: Voice %u requested to play invalid sample %02x\n",i,info->command);
|
/*logerror("OKIM6295: Voice %u requested to play invalid sample %02x\n",i,info->command);*/
|
||||||
voice->playing = 0;
|
voice->playing = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "rf5c68.h"
|
#include "rf5c68.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#undef NULL
|
||||||
#define NULL ((void *)0)
|
#define NULL ((void *)0)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -961,7 +961,7 @@ void ym2151_write_reg(void *_chip, int r, int v)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logerror("YM2151 Write %02x to undocumented register #%02x\n",v,r);
|
/*logerror("YM2151 Write %02x to undocumented register #%02x\n",v,r);*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1575,7 +1575,7 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
|
||||||
if ((chip->rhythm&0x20)==0)
|
if ((chip->rhythm&0x20)==0)
|
||||||
/*rhythm off to on*/
|
/*rhythm off to on*/
|
||||||
{
|
{
|
||||||
logerror("YM2413: Rhythm mode enable\n");
|
/*logerror("YM2413: Rhythm mode enable\n");*/
|
||||||
|
|
||||||
/* Load instrument settings for channel seven(chan=6 since we're zero based). (Bass drum) */
|
/* Load instrument settings for channel seven(chan=6 since we're zero based). (Bass drum) */
|
||||||
chan = 6;
|
chan = 6;
|
||||||
|
@ -1637,7 +1637,7 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
|
||||||
if ((chip->rhythm&0x20)==1)
|
if ((chip->rhythm&0x20)==1)
|
||||||
/*rhythm on to off*/
|
/*rhythm on to off*/
|
||||||
{
|
{
|
||||||
logerror("YM2413: Rhythm mode disable\n");
|
/*logerror("YM2413: Rhythm mode disable\n");*/
|
||||||
/* Load instrument settings for channel seven(chan=6 since we're zero based).*/
|
/* Load instrument settings for channel seven(chan=6 since we're zero based).*/
|
||||||
chan = 6;
|
chan = 6;
|
||||||
inst = &chip->inst_tab[chip->instvol_r[chan]>>4][0];
|
inst = &chip->inst_tab[chip->instvol_r[chan]>>4][0];
|
||||||
|
@ -1710,8 +1710,8 @@ static void OPLLWriteReg(YM2413 *chip, int r, int v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (CH->sus!=(v&0x20))
|
/*if (CH->sus!=(v&0x20))
|
||||||
logerror("chan=%i sus=%2x\n",chan,v&0x20);
|
logerror("chan=%i sus=%2x\n",chan,v&0x20);*/
|
||||||
|
|
||||||
CH->sus = v & 0x20;
|
CH->sus = v & 0x20;
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,7 +231,7 @@ value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning:
|
||||||
/* if yes, then let's check if ADPCM memory is mapped and big enough */
|
/* if yes, then let's check if ADPCM memory is mapped and big enough */
|
||||||
if(DELTAT->memory == 0)
|
if(DELTAT->memory == 0)
|
||||||
{
|
{
|
||||||
logerror("YM Delta-T ADPCM rom not mapped\n");
|
/*logerror("YM Delta-T ADPCM rom not mapped\n");*/
|
||||||
DELTAT->portstate = 0x00;
|
DELTAT->portstate = 0x00;
|
||||||
DELTAT->PCM_BSY = 0;
|
DELTAT->PCM_BSY = 0;
|
||||||
}
|
}
|
||||||
|
@ -239,12 +239,12 @@ value: START, REC, MEMDAT, REPEAT, SPOFF, x,x,RESET meaning:
|
||||||
{
|
{
|
||||||
if( DELTAT->end >= DELTAT->memory_size ) /* Check End in Range */
|
if( DELTAT->end >= DELTAT->memory_size ) /* Check End in Range */
|
||||||
{
|
{
|
||||||
logerror("YM Delta-T ADPCM end out of range: $%08x\n", DELTAT->end);
|
/*logerror("YM Delta-T ADPCM end out of range: $%08x\n", DELTAT->end);*/
|
||||||
DELTAT->end = DELTAT->memory_size - 1;
|
DELTAT->end = DELTAT->memory_size - 1;
|
||||||
}
|
}
|
||||||
if( DELTAT->start >= DELTAT->memory_size ) /* Check Start in Range */
|
if( DELTAT->start >= DELTAT->memory_size ) /* Check Start in Range */
|
||||||
{
|
{
|
||||||
logerror("YM Delta-T ADPCM start out of range: $%08x\n", DELTAT->start);
|
/*logerror("YM Delta-T ADPCM start out of range: $%08x\n", DELTAT->start);*/
|
||||||
DELTAT->portstate = 0x00;
|
DELTAT->portstate = 0x00;
|
||||||
DELTAT->PCM_BSY = 0;
|
DELTAT->PCM_BSY = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1120,7 +1120,7 @@ static void write_to_register(ymz280b_state *chip, int data)
|
||||||
case 0x80: // d0-2: DSP Rch, d3: enable Rch (0: yes, 1: no), d4-6: DSP Lch, d7: enable Lch (0: yes, 1: no)
|
case 0x80: // d0-2: DSP Rch, d3: enable Rch (0: yes, 1: no), d4-6: DSP Lch, d7: enable Lch (0: yes, 1: no)
|
||||||
case 0x81: // d0: enable control of $82 (0: yes, 1: no)
|
case 0x81: // d0: enable control of $82 (0: yes, 1: no)
|
||||||
case 0x82: // DSP data
|
case 0x82: // DSP data
|
||||||
logerror("YMZ280B: DSP register write %02X = %02X\n", chip->current_register, data);
|
/*logerror("YMZ280B: DSP register write %02X = %02X\n", chip->current_register, data);*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x84: /* ROM readback / RAM write (high) */
|
case 0x84: /* ROM readback / RAM write (high) */
|
||||||
|
|
|
@ -80,7 +80,7 @@ void Blip_Buffer::clear( int entire_buffer )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Blip_Buffer::blargg_err_t Blip_Buffer::set_sample_rate( long new_rate, int msec )
|
Blip_Buffer::blargg_err_t Blip_Buffer::set_sample_rate( long new_rate, long msec )
|
||||||
{
|
{
|
||||||
if ( buffer_size_ == silent_buf_size )
|
if ( buffer_size_ == silent_buf_size )
|
||||||
{
|
{
|
||||||
|
@ -436,7 +436,7 @@ void Blip_Buffer::mix_samples( blip_sample_t const* in, long count )
|
||||||
buf_t_* out = buffer_ + (offset_ >> BLIP_BUFFER_ACCURACY) + blip_widest_impulse_ / 2;
|
buf_t_* out = buffer_ + (offset_ >> BLIP_BUFFER_ACCURACY) + blip_widest_impulse_ / 2;
|
||||||
|
|
||||||
int const sample_shift = blip_sample_bits - 16;
|
int const sample_shift = blip_sample_bits - 16;
|
||||||
int prev = 0;
|
blip_long prev = 0;
|
||||||
while ( count-- )
|
while ( count-- )
|
||||||
{
|
{
|
||||||
blip_long s = (blip_long) *in++ << sample_shift;
|
blip_long s = (blip_long) *in++ << sample_shift;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
// internal
|
// internal
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#if INT_MAX < 0x7FFFFFFF || LONG_MAX == 0x7FFFFFFF
|
#if INT_MAX < 0x7FFFFFFF || LONG_MAX >= 0x7FFFFFFF
|
||||||
typedef long blip_long;
|
typedef long blip_long;
|
||||||
typedef unsigned long blip_ulong;
|
typedef unsigned long blip_ulong;
|
||||||
#else
|
#else
|
||||||
|
@ -32,7 +32,7 @@ public:
|
||||||
// Sets output sample rate and buffer length in milliseconds (1/1000 sec, defaults
|
// Sets output sample rate and buffer length in milliseconds (1/1000 sec, defaults
|
||||||
// to 1/4 second) and clears buffer. If there isn't enough memory, leaves buffer
|
// to 1/4 second) and clears buffer. If there isn't enough memory, leaves buffer
|
||||||
// untouched and returns "Out of memory", otherwise returns NULL.
|
// untouched and returns "Out of memory", otherwise returns NULL.
|
||||||
blargg_err_t set_sample_rate( long samples_per_sec, int msec_length = 1000 / 4 );
|
blargg_err_t set_sample_rate( long samples_per_sec, long msec_length = 1000 / 4 );
|
||||||
|
|
||||||
// Sets number of source time units per second
|
// Sets number of source time units per second
|
||||||
void clock_rate( long clocks_per_sec );
|
void clock_rate( long clocks_per_sec );
|
||||||
|
@ -67,7 +67,7 @@ public:
|
||||||
long sample_rate() const;
|
long sample_rate() const;
|
||||||
|
|
||||||
// Length of buffer in milliseconds
|
// Length of buffer in milliseconds
|
||||||
int length() const;
|
long length() const;
|
||||||
|
|
||||||
// Number of source time units per second
|
// Number of source time units per second
|
||||||
long clock_rate() const;
|
long clock_rate() const;
|
||||||
|
@ -118,7 +118,7 @@ public:
|
||||||
// Deprecated
|
// Deprecated
|
||||||
typedef blip_resampled_time_t resampled_time_t;
|
typedef blip_resampled_time_t resampled_time_t;
|
||||||
blargg_err_t sample_rate( long r ) { return set_sample_rate( r ); }
|
blargg_err_t sample_rate( long r ) { return set_sample_rate( r ); }
|
||||||
blargg_err_t sample_rate( long r, int msec ) { return set_sample_rate( r, msec ); }
|
blargg_err_t sample_rate( long r, long msec ) { return set_sample_rate( r, msec ); }
|
||||||
private:
|
private:
|
||||||
// noncopyable
|
// noncopyable
|
||||||
Blip_Buffer( const Blip_Buffer& );
|
Blip_Buffer( const Blip_Buffer& );
|
||||||
|
@ -135,7 +135,7 @@ private:
|
||||||
long sample_rate_;
|
long sample_rate_;
|
||||||
long clock_rate_;
|
long clock_rate_;
|
||||||
int bass_freq_;
|
int bass_freq_;
|
||||||
int length_;
|
blip_long length_;
|
||||||
Blip_Buffer* modified_; // non-zero = true (more optimal than using bool, heh)
|
Blip_Buffer* modified_; // non-zero = true (more optimal than using bool, heh)
|
||||||
friend class Blip_Reader;
|
friend class Blip_Reader;
|
||||||
};
|
};
|
||||||
|
@ -280,7 +280,7 @@ class Silent_Blip_Buffer : public Blip_Buffer {
|
||||||
buf_t_ buf [blip_buffer_extra_ + 1];
|
buf_t_ buf [blip_buffer_extra_ + 1];
|
||||||
public:
|
public:
|
||||||
// The following cannot be used (an assertion will fail if attempted):
|
// The following cannot be used (an assertion will fail if attempted):
|
||||||
blargg_err_t set_sample_rate( long samples_per_sec, int msec_length );
|
blargg_err_t set_sample_rate( long samples_per_sec, long msec_length );
|
||||||
blip_time_t count_clocks( long count ) const;
|
blip_time_t count_clocks( long count ) const;
|
||||||
void mix_samples( blip_sample_t const* buf, long count );
|
void mix_samples( blip_sample_t const* buf, long count );
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ inline blip_eq_t::blip_eq_t( double t ) :
|
||||||
inline blip_eq_t::blip_eq_t( double t, long rf, long sr, long cf ) :
|
inline blip_eq_t::blip_eq_t( double t, long rf, long sr, long cf ) :
|
||||||
treble( t ), rolloff_freq( rf ), sample_rate( sr ), cutoff_freq( cf ) { }
|
treble( t ), rolloff_freq( rf ), sample_rate( sr ), cutoff_freq( cf ) { }
|
||||||
|
|
||||||
inline int Blip_Buffer::length() const { return length_; }
|
inline long Blip_Buffer::length() const { return length_; }
|
||||||
inline long Blip_Buffer::samples_avail() const { return (long) (offset_ >> BLIP_BUFFER_ACCURACY); }
|
inline long Blip_Buffer::samples_avail() const { return (long) (offset_ >> BLIP_BUFFER_ACCURACY); }
|
||||||
inline long Blip_Buffer::sample_rate() const { return sample_rate_; }
|
inline long Blip_Buffer::sample_rate() const { return sample_rate_; }
|
||||||
inline int Blip_Buffer::output_latency() const { return blip_widest_impulse_ / 2; }
|
inline int Blip_Buffer::output_latency() const { return blip_widest_impulse_ / 2; }
|
||||||
|
|
|
@ -121,7 +121,7 @@ blargg_err_t Effects_Buffer::set_channel_count( int count, int const* types )
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
for ( int i = chans.size(); --i >= 0; )
|
for ( blip_long i = chans.size(); --i >= 0; )
|
||||||
{
|
{
|
||||||
chan_t& ch = chans [i];
|
chan_t& ch = chans [i];
|
||||||
ch.cfg.vol = 1.0f;
|
ch.cfg.vol = 1.0f;
|
||||||
|
@ -242,7 +242,7 @@ int Effects_Buffer::min_delay() const
|
||||||
return max_read * 1000L / sample_rate();
|
return max_read * 1000L / sample_rate();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Effects_Buffer::max_delay() const
|
blip_long Effects_Buffer::max_delay() const
|
||||||
{
|
{
|
||||||
require( sample_rate() );
|
require( sample_rate() );
|
||||||
return (echo_size / stereo - max_read) * 1000L / sample_rate();
|
return (echo_size / stereo - max_read) * 1000L / sample_rate();
|
||||||
|
@ -250,7 +250,7 @@ int Effects_Buffer::max_delay() const
|
||||||
|
|
||||||
void Effects_Buffer::apply_config()
|
void Effects_Buffer::apply_config()
|
||||||
{
|
{
|
||||||
int i;
|
blip_long i;
|
||||||
|
|
||||||
if ( !bufs_size )
|
if ( !bufs_size )
|
||||||
return;
|
return;
|
||||||
|
@ -406,7 +406,7 @@ void Effects_Buffer::assign_buffers()
|
||||||
CALC_LEVELS( ch.vol, ch_sum, ch_diff, ch_surround );
|
CALC_LEVELS( ch.vol, ch_sum, ch_diff, ch_surround );
|
||||||
CALC_LEVELS( bufs [h].vol, buf_sum, buf_diff, buf_surround );
|
CALC_LEVELS( bufs [h].vol, buf_sum, buf_diff, buf_surround );
|
||||||
|
|
||||||
fixed_t dist = abs( ch_sum - buf_sum ) + abs( ch_diff - buf_diff );
|
fixed_t dist = labs( ch_sum - buf_sum ) + labs( ch_diff - buf_diff );
|
||||||
|
|
||||||
if ( ch_surround != buf_surround )
|
if ( ch_surround != buf_surround )
|
||||||
dist += TO_FIXED( 1 ) / 2;
|
dist += TO_FIXED( 1 ) / 2;
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
|
|
||||||
// Limits of delay (msec)
|
// Limits of delay (msec)
|
||||||
int min_delay() const;
|
int min_delay() const;
|
||||||
int max_delay() const;
|
blip_long max_delay() const;
|
||||||
|
|
||||||
// Per-channel configuration. Two or more channels with matching parameters are
|
// Per-channel configuration. Two or more channels with matching parameters are
|
||||||
// optimized to internally use the same buffer.
|
// optimized to internally use the same buffer.
|
||||||
|
|
|
@ -376,7 +376,7 @@ void Gb_Square::run( blip_time_t time, blip_time_t end_time )
|
||||||
if ( !vol )
|
if ( !vol )
|
||||||
{
|
{
|
||||||
// Maintain phase when not playing
|
// Maintain phase when not playing
|
||||||
int count = (end_time - time + per - 1) / per;
|
blip_long count = (end_time - time + per - 1) / per;
|
||||||
ph += count; // will be masked below
|
ph += count; // will be masked below
|
||||||
time += (blip_time_t) count * per;
|
time += (blip_time_t) count * per;
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ void Gb_Square::run( blip_time_t time, blip_time_t end_time )
|
||||||
|
|
||||||
// Quickly runs LFSR for a large number of clocks. For use when noise is generating
|
// Quickly runs LFSR for a large number of clocks. For use when noise is generating
|
||||||
// no sound.
|
// no sound.
|
||||||
static unsigned run_lfsr( unsigned s, unsigned mask, int count )
|
static unsigned run_lfsr( unsigned s, unsigned mask, blip_long count )
|
||||||
{
|
{
|
||||||
bool const optimized = true; // set to false to use only unoptimized loop in middle
|
bool const optimized = true; // set to false to use only unoptimized loop in middle
|
||||||
|
|
||||||
|
@ -518,11 +518,11 @@ void Gb_Noise::run( blip_time_t time, blip_time_t end_time )
|
||||||
static byte const period1s [8] = { 1, 2, 4, 6, 8, 10, 12, 14 };
|
static byte const period1s [8] = { 1, 2, 4, 6, 8, 10, 12, 14 };
|
||||||
int const period1 = period1s [regs [3] & 7] * clk_mul;
|
int const period1 = period1s [regs [3] & 7] * clk_mul;
|
||||||
{
|
{
|
||||||
int extra = (end_time - time) - delay;
|
blip_long extra = (end_time - time) - delay;
|
||||||
int const per2 = this->period2();
|
int const per2 = this->period2();
|
||||||
time += delay + ((divider ^ (per2 >> 1)) & (per2 - 1)) * period1;
|
time += delay + ((divider ^ (per2 >> 1)) & (per2 - 1)) * period1;
|
||||||
|
|
||||||
int count = (extra < 0 ? 0 : (extra + period1 - 1) / period1);
|
blip_long count = (extra < 0 ? 0 : (extra + period1 - 1) / period1);
|
||||||
divider = (divider - count) & period2_mask;
|
divider = (divider - count) & period2_mask;
|
||||||
delay = count * period1 - extra;
|
delay = count * period1 - extra;
|
||||||
}
|
}
|
||||||
|
@ -541,7 +541,7 @@ void Gb_Noise::run( blip_time_t time, blip_time_t end_time )
|
||||||
else if ( !vol )
|
else if ( !vol )
|
||||||
{
|
{
|
||||||
// Maintain phase when not playing
|
// Maintain phase when not playing
|
||||||
int count = (end_time - time + per - 1) / per;
|
blip_long count = (end_time - time + per - 1) / per;
|
||||||
time += (blip_time_t) count * per;
|
time += (blip_time_t) count * per;
|
||||||
bits = run_lfsr( bits, ~mask, count );
|
bits = run_lfsr( bits, ~mask, count );
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ void Gb_Wave::run( blip_time_t time, blip_time_t end_time )
|
||||||
if ( !playing )
|
if ( !playing )
|
||||||
{
|
{
|
||||||
// Maintain phase when not playing
|
// Maintain phase when not playing
|
||||||
int count = (end_time - time + per - 1) / per;
|
blip_long count = (end_time - time + per - 1) / per;
|
||||||
ph += count; // will be masked below
|
ph += count; // will be masked below
|
||||||
time += (blip_time_t) count * per;
|
time += (blip_time_t) count * per;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
Good_Synth const* good_synth;
|
Good_Synth const* good_synth;
|
||||||
Med_Synth const* med_synth;
|
Med_Synth const* med_synth;
|
||||||
|
|
||||||
int delay; // clocks until frequency timer expires
|
blip_long delay; // clocks until frequency timer expires
|
||||||
int length_ctr; // length counter
|
int length_ctr; // length counter
|
||||||
unsigned phase; // waveform phase (or equivalent)
|
unsigned phase; // waveform phase (or equivalent)
|
||||||
bool enabled; // internal enabled flag
|
bool enabled; // internal enabled flag
|
||||||
|
|
|
@ -58,7 +58,7 @@ Mono_Buffer::Mono_Buffer() : Multi_Buffer( 1 )
|
||||||
|
|
||||||
Mono_Buffer::~Mono_Buffer() { }
|
Mono_Buffer::~Mono_Buffer() { }
|
||||||
|
|
||||||
blargg_err_t Mono_Buffer::set_sample_rate( long rate, int msec )
|
blargg_err_t Mono_Buffer::set_sample_rate( long rate, long msec )
|
||||||
{
|
{
|
||||||
RETURN_ERR( buf.set_sample_rate( rate, msec ) );
|
RETURN_ERR( buf.set_sample_rate( rate, msec ) );
|
||||||
return Multi_Buffer::set_sample_rate( buf.sample_rate(), buf.length() );
|
return Multi_Buffer::set_sample_rate( buf.sample_rate(), buf.length() );
|
||||||
|
@ -138,7 +138,7 @@ Stereo_Buffer::Stereo_Buffer() : Multi_Buffer( 2 )
|
||||||
|
|
||||||
Stereo_Buffer::~Stereo_Buffer() { }
|
Stereo_Buffer::~Stereo_Buffer() { }
|
||||||
|
|
||||||
blargg_err_t Stereo_Buffer::set_sample_rate( long rate, int msec )
|
blargg_err_t Stereo_Buffer::set_sample_rate( long rate, long msec )
|
||||||
{
|
{
|
||||||
mixer.samples_read = 0;
|
mixer.samples_read = 0;
|
||||||
for ( int i = bufs_size; --i >= 0; )
|
for ( int i = bufs_size; --i >= 0; )
|
||||||
|
|
|
@ -32,14 +32,14 @@ public:
|
||||||
virtual channel_t channel( int index ) BLARGG_PURE( ; )
|
virtual channel_t channel( int index ) BLARGG_PURE( ; )
|
||||||
|
|
||||||
// See Blip_Buffer.h
|
// See Blip_Buffer.h
|
||||||
virtual blargg_err_t set_sample_rate( long rate, int msec = blip_default_length ) BLARGG_PURE( ; )
|
virtual blargg_err_t set_sample_rate( long rate, long msec = blip_default_length ) BLARGG_PURE( ; )
|
||||||
virtual void clock_rate( long ) BLARGG_PURE( { } )
|
virtual void clock_rate( long ) BLARGG_PURE( { } )
|
||||||
virtual void bass_freq( int ) BLARGG_PURE( { } )
|
virtual void bass_freq( int ) BLARGG_PURE( { } )
|
||||||
virtual void clear() BLARGG_PURE( { } )
|
virtual void clear() BLARGG_PURE( { } )
|
||||||
long sample_rate() const;
|
long sample_rate() const;
|
||||||
|
|
||||||
// Length of buffer, in milliseconds
|
// Length of buffer, in milliseconds
|
||||||
int length() const;
|
long length() const;
|
||||||
|
|
||||||
// See Blip_Buffer.h
|
// See Blip_Buffer.h
|
||||||
virtual void end_frame( blip_time_t ) BLARGG_PURE( { } )
|
virtual void end_frame( blip_time_t ) BLARGG_PURE( { } )
|
||||||
|
@ -69,7 +69,7 @@ private:
|
||||||
|
|
||||||
unsigned channels_changed_count_;
|
unsigned channels_changed_count_;
|
||||||
long sample_rate_;
|
long sample_rate_;
|
||||||
int length_;
|
long length_;
|
||||||
int channel_count_;
|
int channel_count_;
|
||||||
int const samples_per_frame_;
|
int const samples_per_frame_;
|
||||||
int const* channel_types_;
|
int const* channel_types_;
|
||||||
|
@ -87,7 +87,7 @@ public:
|
||||||
public:
|
public:
|
||||||
Mono_Buffer();
|
Mono_Buffer();
|
||||||
~Mono_Buffer();
|
~Mono_Buffer();
|
||||||
blargg_err_t set_sample_rate( long rate, int msec = blip_default_length );
|
blargg_err_t set_sample_rate( long rate, long msec = blip_default_length );
|
||||||
void clock_rate( long rate ) { buf.clock_rate( rate ); }
|
void clock_rate( long rate ) { buf.clock_rate( rate ); }
|
||||||
void bass_freq( int freq ) { buf.bass_freq( freq ); }
|
void bass_freq( int freq ) { buf.bass_freq( freq ); }
|
||||||
void clear() { buf.clear(); }
|
void clear() { buf.clear(); }
|
||||||
|
@ -144,7 +144,7 @@ public:
|
||||||
public:
|
public:
|
||||||
Stereo_Buffer();
|
Stereo_Buffer();
|
||||||
~Stereo_Buffer();
|
~Stereo_Buffer();
|
||||||
blargg_err_t set_sample_rate( long, int msec = blip_default_length );
|
blargg_err_t set_sample_rate( long, long msec = blip_default_length );
|
||||||
void clock_rate( long );
|
void clock_rate( long );
|
||||||
void bass_freq( int );
|
void bass_freq( int );
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -168,7 +168,7 @@ class Silent_Buffer : public Multi_Buffer {
|
||||||
channel_t chan;
|
channel_t chan;
|
||||||
public:
|
public:
|
||||||
Silent_Buffer();
|
Silent_Buffer();
|
||||||
blargg_err_t set_sample_rate( long rate, int msec = blip_default_length );
|
blargg_err_t set_sample_rate( long rate, long msec = blip_default_length );
|
||||||
void clock_rate( long ) { }
|
void clock_rate( long ) { }
|
||||||
void bass_freq( int ) { }
|
void bass_freq( int ) { }
|
||||||
void clear() { }
|
void clear() { }
|
||||||
|
@ -179,14 +179,14 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline blargg_err_t Multi_Buffer::set_sample_rate( long rate, int msec )
|
inline blargg_err_t Multi_Buffer::set_sample_rate( long rate, long msec )
|
||||||
{
|
{
|
||||||
sample_rate_ = rate;
|
sample_rate_ = rate;
|
||||||
length_ = msec;
|
length_ = msec;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline blargg_err_t Silent_Buffer::set_sample_rate( long rate, int msec )
|
inline blargg_err_t Silent_Buffer::set_sample_rate( long rate, long msec )
|
||||||
{
|
{
|
||||||
return Multi_Buffer::set_sample_rate( rate, msec );
|
return Multi_Buffer::set_sample_rate( rate, msec );
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ inline int Multi_Buffer::samples_per_frame() const { return samples_per_frame_;
|
||||||
|
|
||||||
inline long Multi_Buffer::sample_rate() const { return sample_rate_; }
|
inline long Multi_Buffer::sample_rate() const { return sample_rate_; }
|
||||||
|
|
||||||
inline int Multi_Buffer::length() const { return length_; }
|
inline long Multi_Buffer::length() const { return length_; }
|
||||||
|
|
||||||
inline blargg_err_t Multi_Buffer::set_channel_count( int n, int const* types )
|
inline blargg_err_t Multi_Buffer::set_channel_count( int n, int const* types )
|
||||||
{
|
{
|
||||||
|
|
|
@ -130,7 +130,7 @@ public:
|
||||||
|
|
||||||
// blargg_long/blargg_ulong = at least 32 bits, int if it's big enough
|
// blargg_long/blargg_ulong = at least 32 bits, int if it's big enough
|
||||||
|
|
||||||
#if INT_MAX < 0x7FFFFFFF || LONG_MAX == 0x7FFFFFFF
|
#if INT_MAX < 0x7FFFFFFF || LONG_MAX >= 0x7FFFFFFF
|
||||||
typedef long blargg_long;
|
typedef long blargg_long;
|
||||||
#else
|
#else
|
||||||
typedef int blargg_long;
|
typedef int blargg_long;
|
||||||
|
|
|
@ -106,7 +106,7 @@ static INSN_REGPARM void armUnknownInsn(GBASystem *gba, u32 opcode)
|
||||||
#define VALUE_LSL_REG_C \
|
#define VALUE_LSL_REG_C \
|
||||||
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
||||||
unsigned int rm = gba->reg[opcode & 0x0F].I; \
|
unsigned int rm = gba->reg[opcode & 0x0F].I; \
|
||||||
if(opcode & 0x0F == 15) { \
|
if((opcode & 0x0F) == 15) { \
|
||||||
rm += 4; \
|
rm += 4; \
|
||||||
} \
|
} \
|
||||||
if (LIKELY(shift)) { \
|
if (LIKELY(shift)) { \
|
||||||
|
@ -142,7 +142,7 @@ static INSN_REGPARM void armUnknownInsn(GBASystem *gba, u32 opcode)
|
||||||
#define VALUE_LSR_REG_C \
|
#define VALUE_LSR_REG_C \
|
||||||
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
||||||
unsigned int rm = gba->reg[opcode & 0x0F].I; \
|
unsigned int rm = gba->reg[opcode & 0x0F].I; \
|
||||||
if(opcode & 0x0F == 15) { \
|
if((opcode & 0x0F) == 15) { \
|
||||||
rm += 4; \
|
rm += 4; \
|
||||||
} \
|
} \
|
||||||
if (LIKELY(shift)) { \
|
if (LIKELY(shift)) { \
|
||||||
|
@ -184,7 +184,7 @@ static INSN_REGPARM void armUnknownInsn(GBASystem *gba, u32 opcode)
|
||||||
#define VALUE_ASR_REG_C \
|
#define VALUE_ASR_REG_C \
|
||||||
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
||||||
s32 rm = gba->reg[opcode & 0x0F].I; \
|
s32 rm = gba->reg[opcode & 0x0F].I; \
|
||||||
if(opcode & 0x0F == 15) { \
|
if((opcode & 0x0F) == 15) { \
|
||||||
rm += 4; \
|
rm += 4; \
|
||||||
} \
|
} \
|
||||||
if (LIKELY(shift < 32)) { \
|
if (LIKELY(shift < 32)) { \
|
||||||
|
@ -225,7 +225,7 @@ static INSN_REGPARM void armUnknownInsn(GBASystem *gba, u32 opcode)
|
||||||
#define VALUE_ROR_REG_C \
|
#define VALUE_ROR_REG_C \
|
||||||
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
unsigned int shift = gba->reg[(opcode >> 8)&15].B.B0; \
|
||||||
unsigned int rm = gba->reg[opcode & 0x0F].I; \
|
unsigned int rm = gba->reg[opcode & 0x0F].I; \
|
||||||
if(opcode & 0x0F == 15) { \
|
if((opcode & 0x0F) == 15) { \
|
||||||
rm += 4; \
|
rm += 4; \
|
||||||
} \
|
} \
|
||||||
if (LIKELY(shift & 0x1F)) { \
|
if (LIKELY(shift & 0x1F)) { \
|
||||||
|
@ -365,11 +365,13 @@ static INSN_REGPARM void armUnknownInsn(GBASystem *gba, u32 opcode)
|
||||||
#ifndef OP_TST
|
#ifndef OP_TST
|
||||||
#define OP_TST \
|
#define OP_TST \
|
||||||
u32 res = gba->reg[(opcode >> 16) & 0x0F].I & value; \
|
u32 res = gba->reg[(opcode >> 16) & 0x0F].I & value; \
|
||||||
|
(void)dest; \
|
||||||
C_SETCOND_LOGICAL;
|
C_SETCOND_LOGICAL;
|
||||||
#endif
|
#endif
|
||||||
#ifndef OP_TEQ
|
#ifndef OP_TEQ
|
||||||
#define OP_TEQ \
|
#define OP_TEQ \
|
||||||
u32 res = gba->reg[(opcode >> 16) & 0x0F].I ^ value; \
|
u32 res = gba->reg[(opcode >> 16) & 0x0F].I ^ value; \
|
||||||
|
(void)dest; \
|
||||||
C_SETCOND_LOGICAL;
|
C_SETCOND_LOGICAL;
|
||||||
#endif
|
#endif
|
||||||
#ifndef OP_CMP
|
#ifndef OP_CMP
|
||||||
|
@ -377,6 +379,7 @@ static INSN_REGPARM void armUnknownInsn(GBASystem *gba, u32 opcode)
|
||||||
u32 lhs = gba->reg[(opcode>>16)&15].I; \
|
u32 lhs = gba->reg[(opcode>>16)&15].I; \
|
||||||
u32 rhs = value; \
|
u32 rhs = value; \
|
||||||
u32 res = lhs - rhs; \
|
u32 res = lhs - rhs; \
|
||||||
|
(void)dest; \
|
||||||
C_SETCOND_SUB;
|
C_SETCOND_SUB;
|
||||||
#endif
|
#endif
|
||||||
#ifndef OP_CMN
|
#ifndef OP_CMN
|
||||||
|
@ -384,6 +387,7 @@ static INSN_REGPARM void armUnknownInsn(GBASystem *gba, u32 opcode)
|
||||||
u32 lhs = gba->reg[(opcode>>16)&15].I; \
|
u32 lhs = gba->reg[(opcode>>16)&15].I; \
|
||||||
u32 rhs = value; \
|
u32 rhs = value; \
|
||||||
u32 res = lhs + rhs; \
|
u32 res = lhs + rhs; \
|
||||||
|
(void)dest; \
|
||||||
C_SETCOND_ADD;
|
C_SETCOND_ADD;
|
||||||
#endif
|
#endif
|
||||||
#ifndef OP_ORR
|
#ifndef OP_ORR
|
||||||
|
@ -606,6 +610,7 @@ DEFINE_ALU_INSN_C (1F, 3F, MVNS, YES)
|
||||||
gba->clockTicks += 1 + codeTicksAccess32(gba, gba->armNextPC);
|
gba->clockTicks += 1 + codeTicksAccess32(gba, gba->armNextPC);
|
||||||
|
|
||||||
#define OP_MUL \
|
#define OP_MUL \
|
||||||
|
(void)acc; \
|
||||||
gba->reg[dest].I = gba->reg[mult].I * rs;
|
gba->reg[dest].I = gba->reg[mult].I * rs;
|
||||||
#define OP_MLA \
|
#define OP_MLA \
|
||||||
gba->reg[dest].I = gba->reg[mult].I * rs + gba->reg[acc].I;
|
gba->reg[dest].I = gba->reg[mult].I * rs + gba->reg[acc].I;
|
||||||
|
|
|
@ -109,7 +109,7 @@ struct GBASoundOut
|
||||||
{
|
{
|
||||||
virtual ~GBASoundOut() { }
|
virtual ~GBASoundOut() { }
|
||||||
// Receives signed 16-bit stereo audio and a byte count
|
// Receives signed 16-bit stereo audio and a byte count
|
||||||
virtual void write(const void * samples, unsigned bytes) = 0;
|
virtual void write(const void * samples, unsigned long bytes) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GBASystem
|
struct GBASystem
|
||||||
|
|
|
@ -100,7 +100,7 @@ void Gba_Pcm::update( int dac )
|
||||||
if ( gba->soundInterpolation )
|
if ( gba->soundInterpolation )
|
||||||
{
|
{
|
||||||
// base filtering on how long since last sample was output
|
// base filtering on how long since last sample was output
|
||||||
int period = time - last_time;
|
blip_long period = time - last_time;
|
||||||
|
|
||||||
int idx = (unsigned) period / 512;
|
int idx = (unsigned) period / 512;
|
||||||
if ( idx >= 3 )
|
if ( idx >= 3 )
|
||||||
|
@ -297,13 +297,13 @@ void flush_samples(GBASystem *gba, GBA::Multi_Buffer * buffer)
|
||||||
// that don't use the length parameter of the write method.
|
// that don't use the length parameter of the write method.
|
||||||
// TODO: Update the Win32 audio drivers (DS, OAL, XA2), and flush all the
|
// TODO: Update the Win32 audio drivers (DS, OAL, XA2), and flush all the
|
||||||
// samples at once to help reducing the audio delay on all platforms.
|
// samples at once to help reducing the audio delay on all platforms.
|
||||||
int soundBufferLen = ( gba->soundSampleRate / 60 ) * 4;
|
blip_long soundBufferLen = ( gba->soundSampleRate / 60 ) * 4;
|
||||||
|
|
||||||
// soundBufferLen should have a whole number of sample pairs
|
// soundBufferLen should have a whole number of sample pairs
|
||||||
assert( soundBufferLen % (2 * sizeof *gba->soundFinalWave) == 0 );
|
assert( soundBufferLen % (2 * sizeof *gba->soundFinalWave) == 0 );
|
||||||
|
|
||||||
// number of samples in output buffer
|
// number of samples in output buffer
|
||||||
int const out_buf_size = soundBufferLen / sizeof *gba->soundFinalWave;
|
blip_long const out_buf_size = soundBufferLen / sizeof *gba->soundFinalWave;
|
||||||
|
|
||||||
while ( buffer->samples_avail() )
|
while ( buffer->samples_avail() )
|
||||||
{
|
{
|
||||||
|
@ -320,11 +320,11 @@ static void apply_filtering(GBASystem *gba)
|
||||||
gba->soundFiltering_ = gba->soundFiltering;
|
gba->soundFiltering_ = gba->soundFiltering;
|
||||||
|
|
||||||
int const base_freq = (int) (32768 - gba->soundFiltering_ * 16384);
|
int const base_freq = (int) (32768 - gba->soundFiltering_ * 16384);
|
||||||
int const nyquist = gba->stereo_buffer->sample_rate() / 2;
|
blip_long const nyquist = gba->stereo_buffer->sample_rate() / 2;
|
||||||
|
|
||||||
for ( int i = 0; i < 3; i++ )
|
for ( int i = 0; i < 3; i++ )
|
||||||
{
|
{
|
||||||
int cutoff = base_freq >> i;
|
blip_long cutoff = base_freq >> i;
|
||||||
if ( cutoff > nyquist )
|
if ( cutoff > nyquist )
|
||||||
cutoff = nyquist;
|
cutoff = nyquist;
|
||||||
gba->pcm_synth [i].treble_eq( GBA::blip_eq_t( 0, 0, gba->stereo_buffer->sample_rate(), cutoff ) );
|
gba->pcm_synth [i].treble_eq( GBA::blip_eq_t( 0, 0, gba->stereo_buffer->sample_rate(), cutoff ) );
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
8360EF6217F92DB0005208A4 /* psx.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360EF4F17F92DB0005208A4 /* psx.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
8360EF6217F92DB0005208A4 /* psx.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360EF4F17F92DB0005208A4 /* psx.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
8360EF6317F92DB0005208A4 /* r3000.c in Sources */ = {isa = PBXBuildFile; fileRef = 8360EF5017F92DB0005208A4 /* r3000.c */; };
|
8360EF6317F92DB0005208A4 /* r3000.c in Sources */ = {isa = PBXBuildFile; fileRef = 8360EF5017F92DB0005208A4 /* r3000.c */; };
|
||||||
8360EF6417F92DB0005208A4 /* r3000.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360EF5117F92DB0005208A4 /* r3000.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
8360EF6417F92DB0005208A4 /* r3000.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360EF5117F92DB0005208A4 /* r3000.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
8360EF6517F92DB0005208A4 /* r3000asm.c in Sources */ = {isa = PBXBuildFile; fileRef = 8360EF5217F92DB0005208A4 /* r3000asm.c */; };
|
|
||||||
8360EF6617F92DB0005208A4 /* r3000asm.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360EF5317F92DB0005208A4 /* r3000asm.h */; };
|
|
||||||
8360EF6717F92DB0005208A4 /* spu.c in Sources */ = {isa = PBXBuildFile; fileRef = 8360EF5417F92DB0005208A4 /* spu.c */; };
|
8360EF6717F92DB0005208A4 /* spu.c in Sources */ = {isa = PBXBuildFile; fileRef = 8360EF5417F92DB0005208A4 /* spu.c */; };
|
||||||
8360EF6817F92DB0005208A4 /* spu.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360EF5517F92DB0005208A4 /* spu.h */; };
|
8360EF6817F92DB0005208A4 /* spu.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360EF5517F92DB0005208A4 /* spu.h */; };
|
||||||
8360EF6917F92DB0005208A4 /* spucore.c in Sources */ = {isa = PBXBuildFile; fileRef = 8360EF5617F92DB0005208A4 /* spucore.c */; };
|
8360EF6917F92DB0005208A4 /* spucore.c in Sources */ = {isa = PBXBuildFile; fileRef = 8360EF5617F92DB0005208A4 /* spucore.c */; };
|
||||||
|
@ -44,8 +42,6 @@
|
||||||
8360EF4F17F92DB0005208A4 /* psx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = psx.h; path = Core/psx.h; sourceTree = "<group>"; };
|
8360EF4F17F92DB0005208A4 /* psx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = psx.h; path = Core/psx.h; sourceTree = "<group>"; };
|
||||||
8360EF5017F92DB0005208A4 /* r3000.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r3000.c; path = Core/r3000.c; sourceTree = "<group>"; };
|
8360EF5017F92DB0005208A4 /* r3000.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r3000.c; path = Core/r3000.c; sourceTree = "<group>"; };
|
||||||
8360EF5117F92DB0005208A4 /* r3000.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = r3000.h; path = Core/r3000.h; sourceTree = "<group>"; };
|
8360EF5117F92DB0005208A4 /* r3000.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = r3000.h; path = Core/r3000.h; sourceTree = "<group>"; };
|
||||||
8360EF5217F92DB0005208A4 /* r3000asm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = r3000asm.c; path = Core/r3000asm.c; sourceTree = "<group>"; };
|
|
||||||
8360EF5317F92DB0005208A4 /* r3000asm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = r3000asm.h; path = Core/r3000asm.h; sourceTree = "<group>"; };
|
|
||||||
8360EF5417F92DB0005208A4 /* spu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = spu.c; path = Core/spu.c; sourceTree = "<group>"; };
|
8360EF5417F92DB0005208A4 /* spu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = spu.c; path = Core/spu.c; sourceTree = "<group>"; };
|
||||||
8360EF5517F92DB0005208A4 /* spu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spu.h; path = Core/spu.h; sourceTree = "<group>"; };
|
8360EF5517F92DB0005208A4 /* spu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spu.h; path = Core/spu.h; sourceTree = "<group>"; };
|
||||||
8360EF5617F92DB0005208A4 /* spucore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = spucore.c; path = Core/spucore.c; sourceTree = "<group>"; };
|
8360EF5617F92DB0005208A4 /* spucore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = spucore.c; path = Core/spucore.c; sourceTree = "<group>"; };
|
||||||
|
@ -111,8 +107,6 @@
|
||||||
8360EF4F17F92DB0005208A4 /* psx.h */,
|
8360EF4F17F92DB0005208A4 /* psx.h */,
|
||||||
8360EF5017F92DB0005208A4 /* r3000.c */,
|
8360EF5017F92DB0005208A4 /* r3000.c */,
|
||||||
8360EF5117F92DB0005208A4 /* r3000.h */,
|
8360EF5117F92DB0005208A4 /* r3000.h */,
|
||||||
8360EF5217F92DB0005208A4 /* r3000asm.c */,
|
|
||||||
8360EF5317F92DB0005208A4 /* r3000asm.h */,
|
|
||||||
8360EF5417F92DB0005208A4 /* spu.c */,
|
8360EF5417F92DB0005208A4 /* spu.c */,
|
||||||
8360EF5517F92DB0005208A4 /* spu.h */,
|
8360EF5517F92DB0005208A4 /* spu.h */,
|
||||||
8360EF5617F92DB0005208A4 /* spucore.c */,
|
8360EF5617F92DB0005208A4 /* spucore.c */,
|
||||||
|
@ -146,7 +140,6 @@
|
||||||
8360EF5E17F92DB0005208A4 /* iop.h in Headers */,
|
8360EF5E17F92DB0005208A4 /* iop.h in Headers */,
|
||||||
8360EF6417F92DB0005208A4 /* r3000.h in Headers */,
|
8360EF6417F92DB0005208A4 /* r3000.h in Headers */,
|
||||||
8360EF6C17F92DB0005208A4 /* vfs.h in Headers */,
|
8360EF6C17F92DB0005208A4 /* vfs.h in Headers */,
|
||||||
8360EF6617F92DB0005208A4 /* r3000asm.h in Headers */,
|
|
||||||
8360EF6A17F92DB0005208A4 /* spucore.h in Headers */,
|
8360EF6A17F92DB0005208A4 /* spucore.h in Headers */,
|
||||||
8360EF6817F92DB0005208A4 /* spu.h in Headers */,
|
8360EF6817F92DB0005208A4 /* spu.h in Headers */,
|
||||||
8360EF6017F92DB0005208A4 /* ioptimer.h in Headers */,
|
8360EF6017F92DB0005208A4 /* ioptimer.h in Headers */,
|
||||||
|
@ -220,7 +213,6 @@
|
||||||
8360EF6117F92DB0005208A4 /* psx.c in Sources */,
|
8360EF6117F92DB0005208A4 /* psx.c in Sources */,
|
||||||
8360EF6317F92DB0005208A4 /* r3000.c in Sources */,
|
8360EF6317F92DB0005208A4 /* r3000.c in Sources */,
|
||||||
8360EF6917F92DB0005208A4 /* spucore.c in Sources */,
|
8360EF6917F92DB0005208A4 /* spucore.c in Sources */,
|
||||||
8360EF6517F92DB0005208A4 /* r3000asm.c in Sources */,
|
|
||||||
8360EF5D17F92DB0005208A4 /* iop.c in Sources */,
|
8360EF5D17F92DB0005208A4 /* iop.c in Sources */,
|
||||||
8360EF6B17F92DB0005208A4 /* vfs.c in Sources */,
|
8360EF6B17F92DB0005208A4 /* vfs.c in Sources */,
|
||||||
8360EF5A17F92DB0005208A4 /* bios.c in Sources */,
|
8360EF5A17F92DB0005208A4 /* bios.c in Sources */,
|
||||||
|
|
|
@ -51,9 +51,9 @@ sint32 EMU_CALL bios_getenv(
|
||||||
uint8 *romnative = bios_get_image_native();
|
uint8 *romnative = bios_get_image_native();
|
||||||
uint8 whole_env_area[129];
|
uint8 whole_env_area[129];
|
||||||
uint8 *env;
|
uint8 *env;
|
||||||
uint8 *banner = "Highly Experimental";
|
const uint8 *banner = (const uint8 *) "Highly Experimental";
|
||||||
sint32 banner_l = strlen(banner);
|
sint32 banner_l = (sint32) strlen((char *)banner);
|
||||||
sint32 name_l = strlen(name);
|
sint32 name_l = (sint32) strlen(name);
|
||||||
sint32 i;
|
sint32 i;
|
||||||
|
|
||||||
for(i = 0; i < 128; i++) {
|
for(i = 0; i < 128; i++) {
|
||||||
|
@ -90,7 +90,7 @@ sint32 EMU_CALL bios_getenv(
|
||||||
// skip equals sign
|
// skip equals sign
|
||||||
env++;
|
env++;
|
||||||
// compute length
|
// compute length
|
||||||
varnamelen = varnameend - varnamestart;
|
varnamelen = (sint32)(varnameend - varnamestart);
|
||||||
// find the value
|
// find the value
|
||||||
for(;; env++) { uint8 c = *env; if(!c) return 1; if(c != ' ') break; }
|
for(;; env++) { uint8 c = *env; if(!c) return 1; if(c != ' ') break; }
|
||||||
varvalstart = env;
|
varvalstart = env;
|
||||||
|
@ -107,7 +107,7 @@ sint32 EMU_CALL bios_getenv(
|
||||||
// skip trailing quote if it's there
|
// skip trailing quote if it's there
|
||||||
if(isquote && *env == '\"') env++;
|
if(isquote && *env == '\"') env++;
|
||||||
// compute length
|
// compute length
|
||||||
varvallen = varvalend - varvalstart;
|
varvallen = (sint32)(varvalend - varvalstart);
|
||||||
|
|
||||||
// now, if this is the variable name we want...
|
// now, if this is the variable name we want...
|
||||||
if(varnamelen == name_l && !memcmp(varnamestart, name, name_l)) {
|
if(varnamelen == name_l && !memcmp(varnamestart, name, name_l)) {
|
||||||
|
|
|
@ -491,8 +491,8 @@ static void EMU_CALL dma_transfer(struct IOP_STATE *state, uint32 core, uint32 c
|
||||||
uint32 blocksize = (state->dma[core].chan[chan].BCR >> 0) & 0xFFFF;
|
uint32 blocksize = (state->dma[core].chan[chan].BCR >> 0) & 0xFFFF;
|
||||||
uint32 blockcount = (state->dma[core].chan[chan].BCR >> 16) & 0xFFFF;
|
uint32 blockcount = (state->dma[core].chan[chan].BCR >> 16) & 0xFFFF;
|
||||||
int is_writing = (state->dma[core].chan[chan].CHCR >> 0) & 1;
|
int is_writing = (state->dma[core].chan[chan].CHCR >> 0) & 1;
|
||||||
int is_continuous = (state->dma[core].chan[chan].CHCR >> 9) & 1;
|
// int is_continuous = (state->dma[core].chan[chan].CHCR >> 9) & 1;
|
||||||
int is_linked = (state->dma[core].chan[chan].CHCR >> 10) & 1;
|
// int is_linked = (state->dma[core].chan[chan].CHCR >> 10) & 1;
|
||||||
uint32 len = blocksize * 4 * blockcount;
|
uint32 len = blocksize * 4 * blockcount;
|
||||||
// uint32 i;
|
// uint32 i;
|
||||||
uint64 cycles_delay = 0;
|
uint64 cycles_delay = 0;
|
||||||
|
|
|
@ -269,7 +269,7 @@ static EMU_INLINE uint32 EMU_CALL get32lsb(uint8 *src) {
|
||||||
// Determine if an ASCII string exists in a byte block
|
// Determine if an ASCII string exists in a byte block
|
||||||
//
|
//
|
||||||
static int string_exists(const char *block, uint32 len, const char *string) {
|
static int string_exists(const char *block, uint32 len, const char *string) {
|
||||||
uint32 sl = strlen(string);
|
uint32 sl = (uint32)strlen(string);
|
||||||
uint32 i;
|
uint32 i;
|
||||||
if(sl > len) return 0;
|
if(sl > len) return 0;
|
||||||
len = (len - sl) + 1;
|
len = (len - sl) + 1;
|
||||||
|
@ -408,7 +408,7 @@ static sint32 EMU_CALL vread(void *vfsstate, uint8 *ram_native, uint32 ram_size,
|
||||||
#ifdef PSX_BIG_ENDIAN
|
#ifdef PSX_BIG_ENDIAN
|
||||||
vreadswap(ram_native, ofs, len);
|
vreadswap(ram_native, ofs, len);
|
||||||
#endif
|
#endif
|
||||||
r = vfs_read(vfsstate, emufd, ram_native + ofs, len);
|
r = vfs_read(vfsstate, emufd, (char *)ram_native + ofs, len);
|
||||||
#ifdef PSX_BIG_ENDIAN
|
#ifdef PSX_BIG_ENDIAN
|
||||||
vreadswap(ram_native, ofs, len);
|
vreadswap(ram_native, ofs, len);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1477,7 +1477,6 @@ static void EMU_CALL reverb_engine22(struct SPUCORE_STATE *state, uint16 *ram, s
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
static void EMU_CALL reverb_process(struct SPUCORE_STATE *state, uint16 *ram, sint32 *buf, int samples) {
|
static void EMU_CALL reverb_process(struct SPUCORE_STATE *state, uint16 *ram, sint32 *buf, int samples) {
|
||||||
int n;
|
|
||||||
int q = state->reverb.resampler.queue_index;
|
int q = state->reverb.resampler.queue_index;
|
||||||
/*
|
/*
|
||||||
** Sample loop
|
** Sample loop
|
||||||
|
|
|
@ -575,7 +575,7 @@ sint32 EMU_CALL qsound_execute(
|
||||||
//
|
//
|
||||||
// Otherwise return the number of cycles we executed
|
// Otherwise return the number of cycles we executed
|
||||||
//
|
//
|
||||||
r = QSOUNDSTATE->odometer - old_odometer;
|
r = (sint32)(QSOUNDSTATE->odometer - old_odometer);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -501,11 +501,13 @@ void m68k_set_irq(m68ki_cpu_core *m68k, int irqline, int state)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* translate logical to physical addresses */
|
/* translate logical to physical addresses */
|
||||||
|
#if 0
|
||||||
static int m68k_translate( m68ki_cpu_core *m68k, unsigned int *address )
|
static int m68k_translate( m68ki_cpu_core *m68k, unsigned int *address )
|
||||||
{
|
{
|
||||||
/* only applies to the program address space and only does something if the MMU's enabled */
|
/* only applies to the program address space and only does something if the MMU's enabled */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Execute some instructions until we use up cycles clock cycles */
|
/* Execute some instructions until we use up cycles clock cycles */
|
||||||
int m68k_execute(m68ki_cpu_core *m68k, unsigned int cycles)
|
int m68k_execute(m68ki_cpu_core *m68k, unsigned int cycles)
|
||||||
|
|
|
@ -46,6 +46,10 @@
|
||||||
/* ======================================================================== */
|
/* ======================================================================== */
|
||||||
|
|
||||||
/* Check for > 32bit sizes */
|
/* Check for > 32bit sizes */
|
||||||
|
#undef MAKE_INT_8
|
||||||
|
#undef MAKE_INT_16
|
||||||
|
#undef MAKE_INT_32
|
||||||
|
|
||||||
#define MAKE_INT_8(A) (INT8)(A)
|
#define MAKE_INT_8(A) (INT8)(A)
|
||||||
#define MAKE_INT_16(A) (INT16)(A)
|
#define MAKE_INT_16(A) (INT16)(A)
|
||||||
#define MAKE_INT_32(A) (INT32)(A)
|
#define MAKE_INT_32(A) (INT32)(A)
|
||||||
|
@ -281,6 +285,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Configuration switches (see m68kconf.h for explanation) */
|
/* Configuration switches (see m68kconf.h for explanation) */
|
||||||
|
#undef M68K_EMULATE_TRACE
|
||||||
#define M68K_EMULATE_TRACE 0
|
#define M68K_EMULATE_TRACE 0
|
||||||
|
|
||||||
/* Enable or disable trace emulation */
|
/* Enable or disable trace emulation */
|
||||||
|
@ -726,7 +731,9 @@ INLINE void m68kx_write_memory_32_pd(m68ki_cpu_core *m68k, unsigned int address,
|
||||||
*/
|
*/
|
||||||
INLINE UINT32 m68ki_read_imm_16(m68ki_cpu_core *m68k)
|
INLINE UINT32 m68ki_read_imm_16(m68ki_cpu_core *m68k)
|
||||||
{
|
{
|
||||||
|
#if M68K_EMULATE_PREFETCH
|
||||||
UINT32 result;
|
UINT32 result;
|
||||||
|
#endif
|
||||||
uint pc;
|
uint pc;
|
||||||
|
|
||||||
m68ki_check_address_error(m68k, REG_PC, MODE_READ, m68k->s_flag | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */
|
m68ki_check_address_error(m68k, REG_PC, MODE_READ, m68k->s_flag | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */
|
||||||
|
@ -1299,6 +1306,7 @@ INLINE void m68ki_stack_frame_buserr(m68ki_cpu_core *m68k, UINT32 sr)
|
||||||
/* Format 8 stack frame (68010).
|
/* Format 8 stack frame (68010).
|
||||||
* 68010 only. This is the 29 word bus/address error frame.
|
* 68010 only. This is the 29 word bus/address error frame.
|
||||||
*/
|
*/
|
||||||
|
#if 0
|
||||||
void m68ki_stack_frame_1000(m68ki_cpu_core *m68k, UINT32 pc, UINT32 sr, UINT32 vector)
|
void m68ki_stack_frame_1000(m68ki_cpu_core *m68k, UINT32 pc, UINT32 sr, UINT32 vector)
|
||||||
{
|
{
|
||||||
/* VERSION
|
/* VERSION
|
||||||
|
@ -1347,12 +1355,14 @@ void m68ki_stack_frame_1000(m68ki_cpu_core *m68k, UINT32 pc, UINT32 sr, UINT32 v
|
||||||
/* STATUS REGISTER */
|
/* STATUS REGISTER */
|
||||||
m68ki_push_16(m68k, sr);
|
m68ki_push_16(m68k, sr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Format A stack frame (short bus fault).
|
/* Format A stack frame (short bus fault).
|
||||||
* This is used only by 68020 for bus fault and address error
|
* This is used only by 68020 for bus fault and address error
|
||||||
* if the error happens at an instruction boundary.
|
* if the error happens at an instruction boundary.
|
||||||
* PC stacked is address of next instruction.
|
* PC stacked is address of next instruction.
|
||||||
*/
|
*/
|
||||||
|
#if 0
|
||||||
void m68ki_stack_frame_1010(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc)
|
void m68ki_stack_frame_1010(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc)
|
||||||
{
|
{
|
||||||
/* INTERNAL REGISTER */
|
/* INTERNAL REGISTER */
|
||||||
|
@ -1394,12 +1404,14 @@ void m68ki_stack_frame_1010(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT
|
||||||
/* STATUS REGISTER */
|
/* STATUS REGISTER */
|
||||||
m68ki_push_16(m68k, sr);
|
m68ki_push_16(m68k, sr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Format B stack frame (long bus fault).
|
/* Format B stack frame (long bus fault).
|
||||||
* This is used only by 68020 for bus fault and address error
|
* This is used only by 68020 for bus fault and address error
|
||||||
* if the error happens during instruction execution.
|
* if the error happens during instruction execution.
|
||||||
* PC stacked is address of instruction in progress.
|
* PC stacked is address of instruction in progress.
|
||||||
*/
|
*/
|
||||||
|
#if 0
|
||||||
void m68ki_stack_frame_1011(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc)
|
void m68ki_stack_frame_1011(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT32 pc)
|
||||||
{
|
{
|
||||||
/* INTERNAL REGISTERS (18 words) */
|
/* INTERNAL REGISTERS (18 words) */
|
||||||
|
@ -1466,6 +1478,7 @@ void m68ki_stack_frame_1011(m68ki_cpu_core *m68k, UINT32 sr, UINT32 vector, UINT
|
||||||
/* STATUS REGISTER */
|
/* STATUS REGISTER */
|
||||||
m68ki_push_16(m68k, sr);
|
m68ki_push_16(m68k, sr);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Used for Group 2 exceptions.
|
/* Used for Group 2 exceptions.
|
||||||
|
|
|
@ -26060,7 +26060,7 @@ static void m68k_op_ror_32_s(m68ki_cpu_core *m68k)
|
||||||
|
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = res;
|
||||||
m68k->c_flag = src << (9-shift);
|
m68k->c_flag = (unsigned int)(src << (9-shift));
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26132,7 +26132,7 @@ static void m68k_op_ror_32_r(m68ki_cpu_core *m68k)
|
||||||
m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
|
m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
|
||||||
|
|
||||||
*r_dst = res;
|
*r_dst = res;
|
||||||
m68k->c_flag = (src >> ((shift - 1) & 31)) << 8;
|
m68k->c_flag = (unsigned int)((src >> ((shift - 1) & 31)) << 8);
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = res;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
|
@ -26140,8 +26140,8 @@ static void m68k_op_ror_32_r(m68ki_cpu_core *m68k)
|
||||||
}
|
}
|
||||||
|
|
||||||
m68k->c_flag = CFLAG_CLEAR;
|
m68k->c_flag = CFLAG_CLEAR;
|
||||||
m68k->n_flag = NFLAG_32(src);
|
m68k->n_flag = (unsigned int)NFLAG_32(src);
|
||||||
m68k->not_z_flag = src;
|
m68k->not_z_flag = (unsigned int)src;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26304,7 +26304,7 @@ static void m68k_op_rol_32_s(m68ki_cpu_core *m68k)
|
||||||
|
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = res;
|
||||||
m68k->c_flag = src >> (24-shift);
|
m68k->c_flag = (unsigned int)(src >> (24-shift));
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26393,7 +26393,7 @@ static void m68k_op_rol_32_r(m68ki_cpu_core *m68k)
|
||||||
|
|
||||||
*r_dst = res;
|
*r_dst = res;
|
||||||
|
|
||||||
m68k->c_flag = (src >> ((32 - shift) & 0x1f)) << 8;
|
m68k->c_flag = (unsigned int)((src >> ((32 - shift) & 0x1f)) << 8);
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = res;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
|
@ -26401,8 +26401,8 @@ static void m68k_op_rol_32_r(m68ki_cpu_core *m68k)
|
||||||
}
|
}
|
||||||
|
|
||||||
m68k->c_flag = CFLAG_CLEAR;
|
m68k->c_flag = CFLAG_CLEAR;
|
||||||
m68k->n_flag = NFLAG_32(src);
|
m68k->n_flag = (unsigned int)NFLAG_32(src);
|
||||||
m68k->not_z_flag = src;
|
m68k->not_z_flag = (unsigned int)src;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26566,13 +26566,13 @@ static void m68k_op_roxr_32_s(m68ki_cpu_core *m68k)
|
||||||
|
|
||||||
res = ROR_33_64(res, shift);
|
res = ROR_33_64(res, shift);
|
||||||
|
|
||||||
m68k->c_flag = m68k->x_flag = res >> 24;
|
m68k->c_flag = m68k->x_flag = (unsigned int)(res >> 24);
|
||||||
res = MASK_OUT_ABOVE_32(res);
|
res = MASK_OUT_ABOVE_32(res);
|
||||||
|
|
||||||
*r_dst = res;
|
*r_dst = (unsigned int)res;
|
||||||
|
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = (unsigned int)NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = (unsigned int)res;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26652,12 +26652,12 @@ static void m68k_op_roxr_32_r(m68ki_cpu_core *m68k)
|
||||||
|
|
||||||
m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
|
m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
|
||||||
|
|
||||||
m68k->c_flag = m68k->x_flag = res >> 24;
|
m68k->c_flag = m68k->x_flag = (unsigned int)(res >> 24);
|
||||||
res = MASK_OUT_ABOVE_32(res);
|
res = MASK_OUT_ABOVE_32(res);
|
||||||
|
|
||||||
*r_dst = res;
|
*r_dst = (unsigned int)res;
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = (unsigned int)NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = (unsigned int)res;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -26842,13 +26842,13 @@ static void m68k_op_roxl_32_s(m68ki_cpu_core *m68k)
|
||||||
|
|
||||||
res = ROL_33_64(res, shift);
|
res = ROL_33_64(res, shift);
|
||||||
|
|
||||||
m68k->c_flag = m68k->x_flag = res >> 24;
|
m68k->c_flag = m68k->x_flag = (unsigned int)(res >> 24);
|
||||||
res = MASK_OUT_ABOVE_32(res);
|
res = MASK_OUT_ABOVE_32(res);
|
||||||
|
|
||||||
*r_dst = res;
|
*r_dst = (unsigned int)res;
|
||||||
|
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = (unsigned int)NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = (unsigned int)res;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26929,12 +26929,12 @@ static void m68k_op_roxl_32_r(m68ki_cpu_core *m68k)
|
||||||
|
|
||||||
m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
|
m68k->remaining_cycles -= orig_shift<<m68k->cyc_shift;
|
||||||
|
|
||||||
m68k->c_flag = m68k->x_flag = res >> 24;
|
m68k->c_flag = m68k->x_flag = (unsigned int)(res >> 24);
|
||||||
res = MASK_OUT_ABOVE_32(res);
|
res = MASK_OUT_ABOVE_32(res);
|
||||||
|
|
||||||
*r_dst = res;
|
*r_dst = (unsigned int)res;
|
||||||
m68k->n_flag = NFLAG_32(res);
|
m68k->n_flag = (unsigned int)NFLAG_32(res);
|
||||||
m68k->not_z_flag = res;
|
m68k->not_z_flag = (unsigned int)res;
|
||||||
m68k->v_flag = VFLAG_CLEAR;
|
m68k->v_flag = VFLAG_CLEAR;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,12 +100,14 @@ sint32 EMU_CALL sega_init(void) {
|
||||||
const char* EMU_CALL sega_getversion(void) {
|
const char* EMU_CALL sega_getversion(void) {
|
||||||
static const char s[] = "SegaCore0001 (built " __DATE__ ")";
|
static const char s[] = "SegaCore0001 (built " __DATE__ ")";
|
||||||
static char rv[500];
|
static char rv[500];
|
||||||
int sl = strlen(s);
|
int sl = (int)strlen(s);
|
||||||
memcpy(rv, s, sl);
|
memcpy(rv, s, sl);
|
||||||
#ifndef DISABLE_SSF
|
#ifndef DISABLE_SSF
|
||||||
rv[sl] = '\n';
|
rv[sl] = '\n';
|
||||||
#ifdef USE_STARSCREAM
|
#ifdef USE_STARSCREAM
|
||||||
strcpy(rv+sl+1, s68000_get_version());
|
strcpy(rv+sl+1, s68000_get_version());
|
||||||
|
#elif defined(USE_M68K)
|
||||||
|
strcpy(rv+sl+1, "M68K");
|
||||||
#else
|
#else
|
||||||
strcpy(rv+sl+1, "C68K");
|
strcpy(rv+sl+1, "C68K");
|
||||||
#endif
|
#endif
|
||||||
|
@ -228,6 +230,7 @@ static uint32 get32lsb(uint8 *src) {
|
||||||
((((uint32)(src[3])) & 0xFF) << 24);
|
((((uint32)(src[3])) & 0xFF) << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static uint32 get32msb(uint8 *src) {
|
static uint32 get32msb(uint8 *src) {
|
||||||
return
|
return
|
||||||
((((uint32)(src[3])) & 0xFF) << 0) |
|
((((uint32)(src[3])) & 0xFF) << 0) |
|
||||||
|
@ -235,6 +238,7 @@ static uint32 get32msb(uint8 *src) {
|
||||||
((((uint32)(src[1])) & 0xFF) << 16) |
|
((((uint32)(src[1])) & 0xFF) << 16) |
|
||||||
((((uint32)(src[0])) & 0xFF) << 24);
|
((((uint32)(src[0])) & 0xFF) << 24);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
// Static information
|
// Static information
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#if 0
|
||||||
#define MAKELFOPHASEINC(x) (((uint64)(0x100000000)) / ((uint64)(x)))
|
#define MAKELFOPHASEINC(x) (((uint64)(0x100000000)) / ((uint64)(x)))
|
||||||
|
|
||||||
static uint32 lfophaseinctable[0x20] = {
|
static uint32 lfophaseinctable[0x20] = {
|
||||||
|
@ -85,6 +86,7 @@ static uint8 envattackshift[0x3D][4] = {
|
||||||
/* 30-37 */ {4,4,4,4},{3,4,4,4},{3,4,3,4},{3,3,3,4},{3,3,3,3},{2,3,3,3},{2,3,2,3},{2,2,2,3},
|
/* 30-37 */ {4,4,4,4},{3,4,4,4},{3,4,3,4},{3,3,3,4},{3,3,3,3},{2,3,3,3},{2,3,2,3},{2,2,2,3},
|
||||||
/* 38-3C */ {2,2,2,2},{1,2,2,2},{1,2,1,2},{1,1,1,2},{1,1,1,1}
|
/* 38-3C */ {2,2,2,2},{1,2,2,2},{1,2,1,2},{1,1,1,2},{1,1,1,1}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static uint8 envdecayvalue[0x3D][4] = {
|
static uint8 envdecayvalue[0x3D][4] = {
|
||||||
/* 00-07 */ {1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},
|
/* 00-07 */ {1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},{1,1,1,1},
|
||||||
|
@ -97,6 +99,7 @@ static uint8 envdecayvalue[0x3D][4] = {
|
||||||
/* 38-3C */ {4,4,4,4},{8,4,4,4},{8,4,8,4},{8,8,8,4},{8,8,8,8}
|
/* 38-3C */ {4,4,4,4},{8,4,4,4},{8,4,8,4},{8,8,8,4},{8,8,8,8}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
static sint32 adpcmscale[8] = {
|
static sint32 adpcmscale[8] = {
|
||||||
0x0E6, 0x0E6, 0x0E6, 0x0E6, 0x133, 0x199, 0x200, 0x266
|
0x0E6, 0x0E6, 0x0E6, 0x0E6, 0x133, 0x199, 0x200, 0x266
|
||||||
};
|
};
|
||||||
|
@ -105,6 +108,7 @@ static sint32 adpcmdiff[16] = {
|
||||||
1, 3, 5, 7, 9, 11, 13, 15,
|
1, 3, 5, 7, 9, 11, 13, 15,
|
||||||
-1,-3,-5,-7,-9,-11,-13,-15
|
-1,-3,-5,-7,-9,-11,-13,-15
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static sint32 qtable[32] = {
|
static sint32 qtable[32] = {
|
||||||
0x0E00,0x0E80,0x0F00,0x0F80,
|
0x0E00,0x0E80,0x0F00,0x0F80,
|
||||||
|
@ -1655,7 +1659,9 @@ static void chan_aica_store_reg(struct YAM_STATE *state, uint8 ch, uint8 a, uint
|
||||||
// DSP registers
|
// DSP registers
|
||||||
//
|
//
|
||||||
static void coef_write(struct YAM_STATE *state, uint32 n, uint32 d, uint32 mask) {
|
static void coef_write(struct YAM_STATE *state, uint32 n, uint32 d, uint32 mask) {
|
||||||
|
#ifdef ENABLE_DYNAREC
|
||||||
sint16 old = state->coef[n];
|
sint16 old = state->coef[n];
|
||||||
|
#endif
|
||||||
yam_flush(state);
|
yam_flush(state);
|
||||||
n &= 0x7F;
|
n &= 0x7F;
|
||||||
state->coef[n] <<= 3;
|
state->coef[n] <<= 3;
|
||||||
|
@ -1668,7 +1674,9 @@ static void coef_write(struct YAM_STATE *state, uint32 n, uint32 d, uint32 mask)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void madrs_write(struct YAM_STATE *state, uint32 n, uint32 d, uint32 mask) {
|
static void madrs_write(struct YAM_STATE *state, uint32 n, uint32 d, uint32 mask) {
|
||||||
|
#ifdef ENABLE_DYNAREC
|
||||||
uint16 old = state->madrs[n];
|
uint16 old = state->madrs[n];
|
||||||
|
#endif
|
||||||
yam_flush(state);
|
yam_flush(state);
|
||||||
n &= 0x3F;
|
n &= 0x3F;
|
||||||
state->madrs[n] &= ~mask;
|
state->madrs[n] &= ~mask;
|
||||||
|
@ -2345,10 +2353,12 @@ void EMU_CALL yam_aica_store_reg(void *state, uint32 a, uint32 d, uint32 mask, u
|
||||||
//
|
//
|
||||||
// Generate random data
|
// Generate random data
|
||||||
//
|
//
|
||||||
|
#if 0
|
||||||
static uint32 yamrand16(struct YAM_STATE *state) {
|
static uint32 yamrand16(struct YAM_STATE *state) {
|
||||||
state->randseed = 1103515245 * state->randseed + 12345;
|
state->randseed = 1103515245 * state->randseed + 12345;
|
||||||
return state->randseed >> 16;
|
return state->randseed >> 16;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
@ -2795,7 +2805,7 @@ static void __fastcall dsp_sample_interpret(struct YAM_STATE *state) {
|
||||||
if((mpro->__kisxzbon) & 0x80) {
|
if((mpro->__kisxzbon) & 0x80) {
|
||||||
x = state->temp[(state->mdec_ct)&0x7F];
|
x = state->temp[(state->mdec_ct)&0x7F];
|
||||||
state->xzbchoice[XZBCHOICE_ACC] =
|
state->xzbchoice[XZBCHOICE_ACC] =
|
||||||
((((sint64)x) * ((sint64)(state->yychoice[YYCHOICE_FRC_REG]))) >> 12) + x;
|
(sint32)((((sint64)x) * ((sint64)(state->yychoice[YYCHOICE_FRC_REG]))) >> 12) + x;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
state->xzbchoice[XZBCHOICE_TEMP] = state->temp[((mpro->t_0rrrrrrr)+(state->mdec_ct))&0x7F];
|
state->xzbchoice[XZBCHOICE_TEMP] = state->temp[((mpro->t_0rrrrrrr)+(state->mdec_ct))&0x7F];
|
||||||
|
@ -2841,7 +2851,7 @@ static void __fastcall dsp_sample_interpret(struct YAM_STATE *state) {
|
||||||
//
|
//
|
||||||
// Multiply and accumulate
|
// Multiply and accumulate
|
||||||
//
|
//
|
||||||
state->xzbchoice[XZBCHOICE_ACC] = ((((sint64)x) * ((sint64)y)) >> 12) + b;
|
state->xzbchoice[XZBCHOICE_ACC] = (sint32)((((sint64)x) * ((sint64)y)) >> 12) + b;
|
||||||
//
|
//
|
||||||
// Temp write
|
// Temp write
|
||||||
//
|
//
|
||||||
|
@ -2916,6 +2926,7 @@ static void __fastcall dsp_sample_interpret(struct YAM_STATE *state) {
|
||||||
#define STRUCTOFS(thetype,thefield) ((uint32)(&(((struct thetype*)0)->thefield)))
|
#define STRUCTOFS(thetype,thefield) ((uint32)(&(((struct thetype*)0)->thefield)))
|
||||||
#define STATEOFS(thefield) STRUCTOFS(YAM_STATE,thefield)
|
#define STATEOFS(thefield) STRUCTOFS(YAM_STATE,thefield)
|
||||||
|
|
||||||
|
#ifdef ENABLE_DYNAREC
|
||||||
static int instruction_uses_shifted(struct MPRO *mpro) {
|
static int instruction_uses_shifted(struct MPRO *mpro) {
|
||||||
// uses SHIFTED if:
|
// uses SHIFTED if:
|
||||||
// - ADRL and INTERP
|
// - ADRL and INTERP
|
||||||
|
@ -2933,6 +2944,7 @@ static int instruction_uses_shifted(struct MPRO *mpro) {
|
||||||
// otherwise not
|
// otherwise not
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Compile x86 code out of the current DSP program/coef/address set
|
// Compile x86 code out of the current DSP program/coef/address set
|
||||||
|
@ -3315,9 +3327,9 @@ struct render_priority
|
||||||
sint32 channel_number;
|
sint32 channel_number;
|
||||||
sint32 priority_level;
|
sint32 priority_level;
|
||||||
};
|
};
|
||||||
int __cdecl render_priority_compare(void * a, void * b) {
|
int __cdecl render_priority_compare(const void * a, const void * b) {
|
||||||
struct render_priority *_a = (struct render_priority *) a;
|
const struct render_priority *_a = (const struct render_priority *) a;
|
||||||
struct render_priority *_b = (struct render_priority *) b;
|
const struct render_priority *_b = (const struct render_priority *) b;
|
||||||
return _b->priority_level - _a->priority_level;
|
return _b->priority_level - _a->priority_level;
|
||||||
}
|
}
|
||||||
static void render(struct YAM_STATE *state, uint32 odometer, uint32 samples) {
|
static void render(struct YAM_STATE *state, uint32 odometer, uint32 samples) {
|
||||||
|
|
|
@ -246,15 +246,15 @@ void CAntiPredictorExtraHigh3800ToCurrent::AntiPredict(int *pInputArray, int *pO
|
||||||
|
|
||||||
if (FP[0] == 0)
|
if (FP[0] == 0)
|
||||||
{
|
{
|
||||||
EXPAND_8_TIMES(nDotProduct += *pFP * *pFM--; *pFP-- = *(pFP - 1);)
|
EXPAND_8_TIMES(nDotProduct += *pFP * *pFM--; *pFP = *(pFP - 1); --pFP;)
|
||||||
}
|
}
|
||||||
else if (FP[0] > 0)
|
else if (FP[0] > 0)
|
||||||
{
|
{
|
||||||
EXPAND_8_TIMES(nDotProduct += *pFP * *pFM; *pFM-- += ((*pFP >> 30) & 2) - 1; *pFP-- = *(pFP - 1);)
|
EXPAND_8_TIMES(nDotProduct += *pFP * *pFM; *pFM-- += ((*pFP >> 30) & 2) - 1; *pFP = *(pFP - 1); --pFP;)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EXPAND_8_TIMES(nDotProduct += *pFP * *pFM; *pFM-- -= ((*pFP >> 30) & 2) - 1; *pFP-- = *(pFP - 1);)
|
EXPAND_8_TIMES(nDotProduct += *pFP * *pFM; *pFM-- -= ((*pFP >> 30) & 2) - 1; *pFP = *(pFP - 1); --pFP;)
|
||||||
}
|
}
|
||||||
|
|
||||||
*ip -= nDotProduct >> 9;
|
*ip -= nDotProduct >> 9;
|
||||||
|
|
|
@ -75,7 +75,8 @@ uint32 CUnBitArrayOld::DecodeValueRiceUnsigned(uint32 k)
|
||||||
|
|
||||||
// plug through the string of 0's (the overflow)
|
// plug through the string of 0's (the overflow)
|
||||||
uint32 BitInitial = m_nCurrentBitIndex;
|
uint32 BitInitial = m_nCurrentBitIndex;
|
||||||
while (!(m_pBitArray[m_nCurrentBitIndex >> 5] & Powers_of_Two_Reversed[m_nCurrentBitIndex++ & 31])) {}
|
while (!(m_pBitArray[m_nCurrentBitIndex >> 5] & Powers_of_Two_Reversed[m_nCurrentBitIndex & 31])) {++m_nCurrentBitIndex;}
|
||||||
|
++m_nCurrentBitIndex;
|
||||||
|
|
||||||
// if k = 0, your done
|
// if k = 0, your done
|
||||||
if (k == 0)
|
if (k == 0)
|
||||||
|
@ -189,7 +190,8 @@ void CUnBitArrayOld::GenerateArrayOld(int* Output_Array, uint32 Number_of_Elemen
|
||||||
{
|
{
|
||||||
// plug through the string of 0's (the overflow)
|
// plug through the string of 0's (the overflow)
|
||||||
uint32 Bit_Initial = m_nCurrentBitIndex;
|
uint32 Bit_Initial = m_nCurrentBitIndex;
|
||||||
while (!(m_pBitArray[m_nCurrentBitIndex >> 5] & Powers_of_Two_Reversed[m_nCurrentBitIndex++ & 31])) {}
|
while (!(m_pBitArray[m_nCurrentBitIndex >> 5] & Powers_of_Two_Reversed[m_nCurrentBitIndex & 31])) {++m_nCurrentBitIndex;}
|
||||||
|
++m_nCurrentBitIndex;
|
||||||
|
|
||||||
// if k = 0, your done
|
// if k = 0, your done
|
||||||
if (k == 0)
|
if (k == 0)
|
||||||
|
@ -295,7 +297,8 @@ __inline int CUnBitArrayOld::DecodeValueNew(BOOL bCapOverflow)
|
||||||
|
|
||||||
// plug through the string of 0's (the overflow)
|
// plug through the string of 0's (the overflow)
|
||||||
uint32 Bit_Initial = m_nCurrentBitIndex;
|
uint32 Bit_Initial = m_nCurrentBitIndex;
|
||||||
while (!(m_pBitArray[m_nCurrentBitIndex >> 5] & Powers_of_Two_Reversed[m_nCurrentBitIndex++ & 31])) {}
|
while (!(m_pBitArray[m_nCurrentBitIndex >> 5] & Powers_of_Two_Reversed[m_nCurrentBitIndex & 31])) {++m_nCurrentBitIndex;}
|
||||||
|
++m_nCurrentBitIndex;
|
||||||
|
|
||||||
int nOverflow = (m_nCurrentBitIndex - Bit_Initial - 1);
|
int nOverflow = (m_nCurrentBitIndex - Bit_Initial - 1);
|
||||||
|
|
||||||
|
|
|
@ -142,13 +142,15 @@ int decode_header(struct mad_header *header, struct mad_stream *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* layer */
|
/* layer */
|
||||||
header->layer = 4 - mad_bit_read(&stream->ptr, 2);
|
index = 4 - mad_bit_read(&stream->ptr, 2);
|
||||||
|
|
||||||
if (header->layer == 4) {
|
if (index == 4) {
|
||||||
stream->error = MAD_ERROR_BADLAYER;
|
stream->error = MAD_ERROR_BADLAYER;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header->layer = index;
|
||||||
|
|
||||||
/* protection_bit */
|
/* protection_bit */
|
||||||
if (mad_bit_read(&stream->ptr, 1) == 0) {
|
if (mad_bit_read(&stream->ptr, 1) == 0) {
|
||||||
header->flags |= MAD_FLAG_PROTECTION;
|
header->flags |= MAD_FLAG_PROTECTION;
|
||||||
|
|
|
@ -294,7 +294,7 @@ int shn_reader::get_wave_header()
|
||||||
{
|
{
|
||||||
int version = FORMAT_VERSION;
|
int version = FORMAT_VERSION;
|
||||||
int ftype = TYPE_EOF;
|
int ftype = TYPE_EOF;
|
||||||
char *magic = MAGIC;
|
const char *magic = MAGIC;
|
||||||
int internal_ftype;
|
int internal_ftype;
|
||||||
int retval = 1;
|
int retval = 1;
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ void shn_reader::Run()
|
||||||
slong lpcqoffset = 0;
|
slong lpcqoffset = 0;
|
||||||
int version = FORMAT_VERSION, bitshift = 0;
|
int version = FORMAT_VERSION, bitshift = 0;
|
||||||
int ftype = TYPE_EOF;
|
int ftype = TYPE_EOF;
|
||||||
char *magic = MAGIC;
|
const char *magic = MAGIC;
|
||||||
int blocksize = DEFAULT_BLOCK_SIZE, nchan = DEFAULT_NCHAN;
|
int blocksize = DEFAULT_BLOCK_SIZE, nchan = DEFAULT_NCHAN;
|
||||||
int i, chan, nwrap, nskip = DEFAULT_NSKIP;
|
int i, chan, nwrap, nskip = DEFAULT_NSKIP;
|
||||||
int *qlpc = NULL, maxnlpc = DEFAULT_MAXNLPC, nmean = UNDEFINED_UINT;
|
int *qlpc = NULL, maxnlpc = DEFAULT_MAXNLPC, nmean = UNDEFINED_UINT;
|
||||||
|
|
|
@ -108,6 +108,8 @@ namespace TagLib {
|
||||||
bool readAudioProperties = true,
|
bool readAudioProperties = true,
|
||||||
AudioProperties::ReadStyle
|
AudioProperties::ReadStyle
|
||||||
audioPropertiesStyle = AudioProperties::Average) const = 0;
|
audioPropertiesStyle = AudioProperties::Average) const = 0;
|
||||||
|
|
||||||
|
virtual ~FileTypeResolver() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
@ -101,7 +101,7 @@ void MP4::Mp4AudioSampleEntry::parseEntry()
|
||||||
if( DecCfgTag[0] != 0x04 )
|
if( DecCfgTag[0] != 0x04 )
|
||||||
return;
|
return;
|
||||||
// read decoder configuration length
|
// read decoder configuration length
|
||||||
TagLib::uint deccfg_len = mp4file->readSystemsLen();
|
/*TagLib::uint deccfg_len =*/ mp4file->readSystemsLen();
|
||||||
// read object type Id
|
// read object type Id
|
||||||
ByteVector objId = mp4file->readBlock(1);
|
ByteVector objId = mp4file->readBlock(1);
|
||||||
// read stream type id
|
// read stream type id
|
||||||
|
|
|
@ -73,7 +73,7 @@ public:
|
||||||
}
|
}
|
||||||
void clear() {
|
void clear() {
|
||||||
if(autoDelete) {
|
if(autoDelete) {
|
||||||
typename std::list<TP *>::const_iterator it = list.begin();
|
typename std::list<TP *>::iterator it = list.begin();
|
||||||
for(; it != list.end(); ++it)
|
for(; it != list.end(); ++it)
|
||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace TagLib {
|
||||||
|
|
||||||
inline unsigned short byteSwap(unsigned short x)
|
inline unsigned short byteSwap(unsigned short x)
|
||||||
{
|
{
|
||||||
return ((x) >> 8) & 0xff | ((x) & 0xff) << 8;
|
return (((x) >> 8) & 0xff) | (((x) & 0xff) << 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned short combine(unsigned char c1, unsigned char c2)
|
inline unsigned short combine(unsigned char c1, unsigned char c2)
|
||||||
|
|
|
@ -413,7 +413,6 @@ static int accumulate_fit(const float *flr,const float *mdct,
|
||||||
int x0, int x1,lsfit_acc *a,
|
int x0, int x1,lsfit_acc *a,
|
||||||
int n,vorbis_info_floor1 *info){
|
int n,vorbis_info_floor1 *info){
|
||||||
long i;
|
long i;
|
||||||
int quantized=vorbis_dBquant(flr+x0);
|
|
||||||
|
|
||||||
long xa=0,ya=0,x2a=0,y2a=0,xya=0,na=0, xb=0,yb=0,x2b=0,y2b=0,xyb=0,nb=0;
|
long xa=0,ya=0,x2a=0,y2a=0,xya=0,na=0, xb=0,yb=0,x2b=0,y2b=0,xyb=0,nb=0;
|
||||||
|
|
||||||
|
@ -591,8 +590,6 @@ static int post_Y(int *A,int *B,int pos){
|
||||||
return (A[pos]+B[pos])>>1;
|
return (A[pos]+B[pos])>>1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int seq=0;
|
|
||||||
|
|
||||||
int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
|
int *floor1_fit(vorbis_block *vb,vorbis_look_floor1 *look,
|
||||||
const float *logmdct, /* in */
|
const float *logmdct, /* in */
|
||||||
const float *logmask){
|
const float *logmask){
|
||||||
|
@ -763,7 +760,6 @@ int floor1_encode(oggpack_buffer *opb,vorbis_block *vb,
|
||||||
|
|
||||||
long i,j;
|
long i,j;
|
||||||
vorbis_info_floor1 *info=look->vi;
|
vorbis_info_floor1 *info=look->vi;
|
||||||
long n=look->n;
|
|
||||||
long posts=look->posts;
|
long posts=look->posts;
|
||||||
codec_setup_info *ci=vb->vd->vi->codec_setup;
|
codec_setup_info *ci=vb->vd->vi->codec_setup;
|
||||||
int out[VIF_POSIT+2];
|
int out[VIF_POSIT+2];
|
||||||
|
|
|
@ -735,7 +735,6 @@ static int mapping0_inverse(vorbis_block *vb,vorbis_info_mapping *l){
|
||||||
codec_setup_info *ci=vi->codec_setup;
|
codec_setup_info *ci=vi->codec_setup;
|
||||||
private_state *b=vd->backend_state;
|
private_state *b=vd->backend_state;
|
||||||
vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)l;
|
vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)l;
|
||||||
int hs=ci->halfrate_flag;
|
|
||||||
|
|
||||||
int i,j;
|
int i,j;
|
||||||
long n=vb->pcmend=ci->blocksizes[vb->W];
|
long n=vb->pcmend=ci->blocksizes[vb->W];
|
||||||
|
|
|
@ -25,10 +25,6 @@ static void **pointers=NULL;
|
||||||
static long *insertlist=NULL; /* We can't embed this in the pointer list;
|
static long *insertlist=NULL; /* We can't embed this in the pointer list;
|
||||||
a pointer can have any value... */
|
a pointer can have any value... */
|
||||||
|
|
||||||
static char **files=NULL;
|
|
||||||
static long *file_bytes=NULL;
|
|
||||||
static int filecount=0;
|
|
||||||
|
|
||||||
static int ptop=0;
|
static int ptop=0;
|
||||||
static int palloced=0;
|
static int palloced=0;
|
||||||
static int pinsert=0;
|
static int pinsert=0;
|
||||||
|
|
|
@ -1214,7 +1214,6 @@ void hf_reduction(vorbis_info_psy_global *g,
|
||||||
|
|
||||||
int i,j,n=p->n, de=0.3*p->m_val;
|
int i,j,n=p->n, de=0.3*p->m_val;
|
||||||
int limit=g->coupling_pointlimit[p->vi->blockflag][PACKETBLOBS/2];
|
int limit=g->coupling_pointlimit[p->vi->blockflag][PACKETBLOBS/2];
|
||||||
int start=p->vi->normal_start;
|
|
||||||
|
|
||||||
for(i=0; i<vi->coupling_steps; i++){
|
for(i=0; i<vi->coupling_steps; i++){
|
||||||
/* for(j=start; j<limit; j++){} // ???*/
|
/* for(j=start; j<limit; j++){} // ???*/
|
||||||
|
|
|
@ -369,8 +369,6 @@ static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
|
||||||
long i,j,k;
|
long i,j,k;
|
||||||
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
|
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
|
||||||
vorbis_info_residue0 *info=look->info;
|
vorbis_info_residue0 *info=look->info;
|
||||||
vorbis_info *vi=vb->vd->vi;
|
|
||||||
codec_setup_info *ci=vi->codec_setup;
|
|
||||||
|
|
||||||
/* move all this setup out later */
|
/* move all this setup out later */
|
||||||
int samples_per_partition=info->grouping;
|
int samples_per_partition=info->grouping;
|
||||||
|
@ -498,8 +496,6 @@ static int _01forward(oggpack_buffer *opb,
|
||||||
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
|
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
|
||||||
vorbis_info_residue0 *info=look->info;
|
vorbis_info_residue0 *info=look->info;
|
||||||
|
|
||||||
vorbis_dsp_state *vd=vb->vd;
|
|
||||||
|
|
||||||
/* move all this setup out later */
|
/* move all this setup out later */
|
||||||
int samples_per_partition=info->grouping;
|
int samples_per_partition=info->grouping;
|
||||||
int possible_partitions=info->partitions;
|
int possible_partitions=info->partitions;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 42;
|
objectVersion = 46;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
@ -33,7 +33,6 @@
|
||||||
830F0BEA17FC4FB900042E8F /* wmaprodec.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BA817FC4FB900042E8F /* wmaprodec.c */; };
|
830F0BEA17FC4FB900042E8F /* wmaprodec.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BA817FC4FB900042E8F /* wmaprodec.c */; };
|
||||||
830F0BEB17FC4FB900042E8F /* wmavoice.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BA917FC4FB900042E8F /* wmavoice.c */; };
|
830F0BEB17FC4FB900042E8F /* wmavoice.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BA917FC4FB900042E8F /* wmavoice.c */; };
|
||||||
830F0BEC17FC4FB900042E8F /* wmavoice_data.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BAA17FC4FB900042E8F /* wmavoice_data.h */; };
|
830F0BEC17FC4FB900042E8F /* wmavoice_data.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BAA17FC4FB900042E8F /* wmavoice_data.h */; };
|
||||||
830F0BED17FC4FB900042E8F /* mathops.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BAC17FC4FB900042E8F /* mathops.h */; };
|
|
||||||
830F0BEE17FC4FB900042E8F /* allformats.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BAE17FC4FB900042E8F /* allformats.c */; };
|
830F0BEE17FC4FB900042E8F /* allformats.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BAE17FC4FB900042E8F /* allformats.c */; };
|
||||||
830F0BEF17FC4FB900042E8F /* asf.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BAF17FC4FB900042E8F /* asf.c */; };
|
830F0BEF17FC4FB900042E8F /* asf.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0BAF17FC4FB900042E8F /* asf.c */; };
|
||||||
830F0BF017FC4FB900042E8F /* avformat.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BB017FC4FB900042E8F /* avformat.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
830F0BF017FC4FB900042E8F /* avformat.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BB017FC4FB900042E8F /* avformat.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
|
@ -66,7 +65,6 @@
|
||||||
830F0C0B17FC4FB900042E8F /* pixfmt.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BCC17FC4FB900042E8F /* pixfmt.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
830F0C0B17FC4FB900042E8F /* pixfmt.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BCC17FC4FB900042E8F /* pixfmt.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
830F0C0C17FC4FB900042E8F /* rational.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BCD17FC4FB900042E8F /* rational.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
830F0C0C17FC4FB900042E8F /* rational.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BCD17FC4FB900042E8F /* rational.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
830F0C0D17FC4FB900042E8F /* samplefmt.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BCE17FC4FB900042E8F /* samplefmt.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
830F0C0D17FC4FB900042E8F /* samplefmt.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BCE17FC4FB900042E8F /* samplefmt.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
830F0C0E17FC4FB900042E8F /* bswap.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0BD017FC4FB900042E8F /* bswap.h */; };
|
|
||||||
830F0C1117FC4FF400042E8F /* avfft.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0C0F17FC4FF400042E8F /* avfft.c */; };
|
830F0C1117FC4FF400042E8F /* avfft.c in Sources */ = {isa = PBXBuildFile; fileRef = 830F0C0F17FC4FF400042E8F /* avfft.c */; };
|
||||||
830F0C1217FC4FF400042E8F /* avfft.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0C1017FC4FF400042E8F /* avfft.h */; };
|
830F0C1217FC4FF400042E8F /* avfft.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0C1017FC4FF400042E8F /* avfft.h */; };
|
||||||
830F0C1417FC500B00042E8F /* fft-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0C1317FC500B00042E8F /* fft-internal.h */; };
|
830F0C1417FC500B00042E8F /* fft-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 830F0C1317FC500B00042E8F /* fft-internal.h */; };
|
||||||
|
@ -1053,7 +1051,6 @@
|
||||||
830F0CEF17FC7F1E00042E8F /* mpegvideo.h in Headers */,
|
830F0CEF17FC7F1E00042E8F /* mpegvideo.h in Headers */,
|
||||||
830F0C5017FC7CA300042E8F /* riff.h in Headers */,
|
830F0C5017FC7CA300042E8F /* riff.h in Headers */,
|
||||||
830F0D5B17FC893E00042E8F /* tableprint.h in Headers */,
|
830F0D5B17FC893E00042E8F /* tableprint.h in Headers */,
|
||||||
830F0C0E17FC4FB900042E8F /* bswap.h in Headers */,
|
|
||||||
830F0BE117FC4FB900042E8F /* simple_idct.h in Headers */,
|
830F0BE117FC4FB900042E8F /* simple_idct.h in Headers */,
|
||||||
830F0D0C17FC80B400042E8F /* rectangle.h in Headers */,
|
830F0D0C17FC80B400042E8F /* rectangle.h in Headers */,
|
||||||
830F0C2F17FC551F00042E8F /* asfcrypt.h in Headers */,
|
830F0C2F17FC551F00042E8F /* asfcrypt.h in Headers */,
|
||||||
|
@ -1070,7 +1067,6 @@
|
||||||
830F0C1C17FC523000042E8F /* url.h in Headers */,
|
830F0C1C17FC523000042E8F /* url.h in Headers */,
|
||||||
830F0BD717FC4FB900042E8F /* get_bits.h in Headers */,
|
830F0BD717FC4FB900042E8F /* get_bits.h in Headers */,
|
||||||
830F0C2417FC527400042E8F /* atomic.h in Headers */,
|
830F0C2417FC527400042E8F /* atomic.h in Headers */,
|
||||||
830F0BED17FC4FB900042E8F /* mathops.h in Headers */,
|
|
||||||
830F0C5D17FC7CEA00042E8F /* id3v1.h in Headers */,
|
830F0C5D17FC7CEA00042E8F /* id3v1.h in Headers */,
|
||||||
830F0C6A17FC7DB100042E8F /* avassert.h in Headers */,
|
830F0C6A17FC7DB100042E8F /* avassert.h in Headers */,
|
||||||
830F0D6D17FC8C0700042E8F /* aactab.h in Headers */,
|
830F0D6D17FC8C0700042E8F /* aactab.h in Headers */,
|
||||||
|
@ -1158,9 +1154,10 @@
|
||||||
0867D690FE84028FC02AAC07 /* Project object */ = {
|
0867D690FE84028FC02AAC07 /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
|
LastUpgradeCheck = 0500;
|
||||||
};
|
};
|
||||||
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "WMA" */;
|
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "WMA" */;
|
||||||
compatibilityVersion = "Xcode 2.4";
|
compatibilityVersion = "Xcode 3.2";
|
||||||
developmentRegion = English;
|
developmentRegion = English;
|
||||||
hasScannedForEncodings = 1;
|
hasScannedForEncodings = 1;
|
||||||
knownRegions = (
|
knownRegions = (
|
||||||
|
@ -1335,6 +1332,7 @@
|
||||||
1DEB91AE08733DA50010E9CD /* Debug */ = {
|
1DEB91AE08733DA50010E9CD /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
@ -1362,6 +1360,7 @@
|
||||||
1DEB91AF08733DA50010E9CD /* Release */ = {
|
1DEB91AF08733DA50010E9CD /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
DYLIB_CURRENT_VERSION = 1;
|
DYLIB_CURRENT_VERSION = 1;
|
||||||
|
@ -1388,6 +1387,7 @@
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
MACOSX_DEPLOYMENT_TARGET = 10.6;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
PREBINDING = NO;
|
PREBINDING = NO;
|
||||||
SDKROOT = macosx;
|
SDKROOT = macosx;
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,6 +54,8 @@
|
||||||
#define HAVE_PTHREADS 1
|
#define HAVE_PTHREADS 1
|
||||||
#define HAVE_ATOMICS_GCC 1
|
#define HAVE_ATOMICS_GCC 1
|
||||||
#define HAVE_ATOMICS_NATIVE 1
|
#define HAVE_ATOMICS_NATIVE 1
|
||||||
|
#define HAVE_PRAGMA_DEPRECATED 1
|
||||||
|
#define HAVE_UNISTD_H 1
|
||||||
#define CONFIG_FRAME_THREAD_ENCODER 0
|
#define CONFIG_FRAME_THREAD_ENCODER 0
|
||||||
#define SIMPLE_IDCT 1
|
#define SIMPLE_IDCT 1
|
||||||
#define CONFIG_MEMORY_POISONING 0
|
#define CONFIG_MEMORY_POISONING 0
|
||||||
|
|
|
@ -3186,7 +3186,7 @@ typedef struct AVSubtitle {
|
||||||
* if c is non-NULL, returns the next registered codec after c,
|
* if c is non-NULL, returns the next registered codec after c,
|
||||||
* or NULL if c is the last one.
|
* or NULL if c is the last one.
|
||||||
*/
|
*/
|
||||||
AVCodec *av_codec_next(const AVCodec *c);
|
const AVCodec *av_codec_next(const AVCodec *c);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the LIBAVCODEC_VERSION_INT constant.
|
* Return the LIBAVCODEC_VERSION_INT constant.
|
||||||
|
|
|
@ -275,7 +275,7 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
|
||||||
|
|
||||||
vlc->bits = nb_bits;
|
vlc->bits = nb_bits;
|
||||||
if (flags & INIT_VLC_USE_NEW_STATIC) {
|
if (flags & INIT_VLC_USE_NEW_STATIC) {
|
||||||
while (state = avpriv_atomic_ptr_cas(&vlc->init_state, NULL, vlc)) {
|
while ((state = avpriv_atomic_ptr_cas(&vlc->init_state, NULL, vlc))) {
|
||||||
if (state == vlc + 1) {
|
if (state == vlc + 1) {
|
||||||
av_assert0(vlc->table_size && vlc->table_size == vlc->table_allocated);
|
av_assert0(vlc->table_size && vlc->table_size == vlc->table_allocated);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -900,7 +900,7 @@ void ff_er_frame_end(ERContext *s)
|
||||||
s->cur_pic->motion_val_buf[i] = av_buffer_allocz((size + 4) * 2 * sizeof(uint16_t));
|
s->cur_pic->motion_val_buf[i] = av_buffer_allocz((size + 4) * 2 * sizeof(uint16_t));
|
||||||
if (!s->cur_pic->ref_index_buf[i] || !s->cur_pic->motion_val_buf[i])
|
if (!s->cur_pic->ref_index_buf[i] || !s->cur_pic->motion_val_buf[i])
|
||||||
break;
|
break;
|
||||||
s->cur_pic->ref_index[i] = s->cur_pic->ref_index_buf[i]->data;
|
s->cur_pic->ref_index[i] = (int8_t*) s->cur_pic->ref_index_buf[i]->data;
|
||||||
s->cur_pic->motion_val[i] = (int16_t (*)[2])s->cur_pic->motion_val_buf[i]->data + 4;
|
s->cur_pic->motion_val[i] = (int16_t (*)[2])s->cur_pic->motion_val_buf[i]->data + 4;
|
||||||
}
|
}
|
||||||
if (i < 2) {
|
if (i < 2) {
|
||||||
|
|
|
@ -209,7 +209,7 @@ int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
|
||||||
int has_alpha)
|
int has_alpha)
|
||||||
{
|
{
|
||||||
int loss;
|
int loss;
|
||||||
int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, &loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
|
int ret = get_pix_fmt_score(dst_pix_fmt, src_pix_fmt, (unsigned int *)&loss, has_alpha ? ~0 : ~FF_LOSS_ALPHA);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
return loss;
|
return loss;
|
||||||
|
@ -229,8 +229,8 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt
|
||||||
loss_mask &= ~FF_LOSS_ALPHA;
|
loss_mask &= ~FF_LOSS_ALPHA;
|
||||||
|
|
||||||
dst_pix_fmt = AV_PIX_FMT_NONE;
|
dst_pix_fmt = AV_PIX_FMT_NONE;
|
||||||
score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, &loss1, loss_mask);
|
score1 = get_pix_fmt_score(dst_pix_fmt1, src_pix_fmt, (unsigned int *)&loss1, loss_mask);
|
||||||
score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, &loss2, loss_mask);
|
score2 = get_pix_fmt_score(dst_pix_fmt2, src_pix_fmt, (unsigned int *)&loss2, loss_mask);
|
||||||
|
|
||||||
if (score1 == score2) {
|
if (score1 == score2) {
|
||||||
if(av_get_padded_bits_per_pixel(desc2) != av_get_padded_bits_per_pixel(desc1)) {
|
if(av_get_padded_bits_per_pixel(desc2) != av_get_padded_bits_per_pixel(desc1)) {
|
||||||
|
|
|
@ -53,7 +53,7 @@ static void *codec_child_next(void *obj, void *prev)
|
||||||
|
|
||||||
static const AVClass *codec_child_class_next(const AVClass *prev)
|
static const AVClass *codec_child_class_next(const AVClass *prev)
|
||||||
{
|
{
|
||||||
AVCodec *c = NULL;
|
const AVCodec *c = NULL;
|
||||||
|
|
||||||
/* find the codec that corresponds to prev */
|
/* find the codec that corresponds to prev */
|
||||||
while (prev && (c = av_codec_next(c)))
|
while (prev && (c = av_codec_next(c)))
|
||||||
|
@ -61,7 +61,7 @@ static const AVClass *codec_child_class_next(const AVClass *prev)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* find next codec with priv options */
|
/* find next codec with priv options */
|
||||||
while (c = av_codec_next(c))
|
while ((c = av_codec_next(c)))
|
||||||
if (c->priv_class)
|
if (c->priv_class)
|
||||||
return c->priv_class;
|
return c->priv_class;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -111,7 +111,9 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
|
||||||
flags= AV_OPT_FLAG_VIDEO_PARAM;
|
flags= AV_OPT_FLAG_VIDEO_PARAM;
|
||||||
else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
|
else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
|
||||||
flags= AV_OPT_FLAG_SUBTITLE_PARAM;
|
flags= AV_OPT_FLAG_SUBTITLE_PARAM;
|
||||||
|
AV_NOWARN_DEPRECATED(
|
||||||
av_opt_set_defaults2(s, flags, flags);
|
av_opt_set_defaults2(s, flags, flags);
|
||||||
|
);
|
||||||
|
|
||||||
s->time_base = (AVRational){0,1};
|
s->time_base = (AVRational){0,1};
|
||||||
s->get_buffer2 = avcodec_default_get_buffer2;
|
s->get_buffer2 = avcodec_default_get_buffer2;
|
||||||
|
@ -140,7 +142,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
|
||||||
int ret;
|
int ret;
|
||||||
const AVCodecDefault *d = codec->defaults;
|
const AVCodecDefault *d = codec->defaults;
|
||||||
while (d->key) {
|
while (d->key) {
|
||||||
ret = av_opt_set(s, d->key, d->value, 0);
|
ret = av_opt_set(s, (const char *) d->key, (const char *) d->value, 0);
|
||||||
av_assert0(ret >= 0);
|
av_assert0(ret >= 0);
|
||||||
d++;
|
d++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ void av_fast_padded_mallocz(void *ptr, unsigned int *size, size_t min_size)
|
||||||
/* encoder management */
|
/* encoder management */
|
||||||
static AVCodec *first_avcodec = NULL;
|
static AVCodec *first_avcodec = NULL;
|
||||||
|
|
||||||
AVCodec *av_codec_next(const AVCodec *c)
|
const AVCodec *av_codec_next(const AVCodec *c)
|
||||||
{
|
{
|
||||||
if (c)
|
if (c)
|
||||||
return c->next;
|
return c->next;
|
||||||
|
@ -712,6 +712,7 @@ int ff_init_buffer_info(AVCodecContext *avctx, AVFrame *frame)
|
||||||
}
|
}
|
||||||
av_frame_set_channels(frame, avctx->channels);
|
av_frame_set_channels(frame, avctx->channels);
|
||||||
break;
|
break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -921,7 +922,7 @@ static int reget_buffer_internal(AVCodecContext *avctx, AVFrame *frame)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
av_image_copy(frame->data, frame->linesize, tmp.data, tmp.linesize,
|
av_image_copy(frame->data, frame->linesize, (const uint8_t **)tmp.data, tmp.linesize,
|
||||||
frame->format, frame->width, frame->height);
|
frame->format, frame->width, frame->height);
|
||||||
|
|
||||||
av_frame_unref(&tmp);
|
av_frame_unref(&tmp);
|
||||||
|
@ -1376,7 +1377,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
|
||||||
avctx->channel_layout = 0;
|
avctx->channel_layout = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (avctx->channels && avctx->channels < 0 ||
|
if (avctx->channels < 0 ||
|
||||||
avctx->channels > FF_SANE_NB_CHANNELS) {
|
avctx->channels > FF_SANE_NB_CHANNELS) {
|
||||||
ret = AVERROR(EINVAL);
|
ret = AVERROR(EINVAL);
|
||||||
goto free_and_end;
|
goto free_and_end;
|
||||||
|
@ -1455,7 +1456,7 @@ int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
|
||||||
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
|
av_fast_padded_malloc(&avctx->internal->byte_buffer, &avctx->internal->byte_buffer_size, size);
|
||||||
avpkt->data = avctx->internal->byte_buffer;
|
avpkt->data = avctx->internal->byte_buffer;
|
||||||
avpkt->size = avctx->internal->byte_buffer_size;
|
avpkt->size = avctx->internal->byte_buffer_size;
|
||||||
avpkt->destruct = NULL;
|
AV_NOWARN_DEPRECATED( avpkt->destruct = NULL; );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1622,7 +1623,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
||||||
}
|
}
|
||||||
avpkt->buf = user_pkt.buf;
|
avpkt->buf = user_pkt.buf;
|
||||||
avpkt->data = user_pkt.data;
|
avpkt->data = user_pkt.data;
|
||||||
avpkt->destruct = user_pkt.destruct;
|
AV_NOWARN_DEPRECATED( avpkt->destruct = user_pkt.destruct; );
|
||||||
} else {
|
} else {
|
||||||
if (av_dup_packet(avpkt) < 0) {
|
if (av_dup_packet(avpkt) < 0) {
|
||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
@ -1816,7 +1817,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
|
||||||
}
|
}
|
||||||
avpkt->buf = user_pkt.buf;
|
avpkt->buf = user_pkt.buf;
|
||||||
avpkt->data = user_pkt.data;
|
avpkt->data = user_pkt.data;
|
||||||
avpkt->destruct = user_pkt.destruct;
|
AV_NOWARN_DEPRECATED( avpkt->destruct = user_pkt.destruct; );
|
||||||
} else {
|
} else {
|
||||||
if (av_dup_packet(avpkt) < 0) {
|
if (av_dup_packet(avpkt) < 0) {
|
||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
|
@ -1949,11 +1950,11 @@ static int add_metadata_from_side_data(AVCodecContext *avctx, AVFrame *frame)
|
||||||
end = side_metadata + size;
|
end = side_metadata + size;
|
||||||
while (side_metadata < end) {
|
while (side_metadata < end) {
|
||||||
const uint8_t *key = side_metadata;
|
const uint8_t *key = side_metadata;
|
||||||
const uint8_t *val = side_metadata + strlen(key) + 1;
|
const uint8_t *val = side_metadata + strlen((const char *)key) + 1;
|
||||||
int ret = av_dict_set(avpriv_frame_get_metadatap(frame), key, val, 0);
|
int ret = av_dict_set(avpriv_frame_get_metadatap(frame), (const char *)key, (const char *)val, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
break;
|
break;
|
||||||
side_metadata = val + strlen(val) + 1;
|
side_metadata = val + strlen((const char *)val) + 1;
|
||||||
}
|
}
|
||||||
end:
|
end:
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2313,7 +2314,7 @@ static int utf8_check(const uint8_t *str)
|
||||||
1 << (5 * (byte - str) - 4);
|
1 << (5 * (byte - str) - 4);
|
||||||
if (codepoint < min || codepoint >= 0x110000 ||
|
if (codepoint < min || codepoint >= 0x110000 ||
|
||||||
codepoint == 0xFFFE /* BOM */ ||
|
codepoint == 0xFFFE /* BOM */ ||
|
||||||
codepoint >= 0xD800 && codepoint <= 0xDFFF /* surrogates */)
|
(codepoint >= 0xD800 && codepoint <= 0xDFFF) /* surrogates */)
|
||||||
return 0;
|
return 0;
|
||||||
str = byte;
|
str = byte;
|
||||||
}
|
}
|
||||||
|
@ -2362,7 +2363,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < sub->num_rects; i++) {
|
for (i = 0; i < sub->num_rects; i++) {
|
||||||
if (sub->rects[i]->ass && !utf8_check(sub->rects[i]->ass)) {
|
if (sub->rects[i]->ass && !utf8_check((const uint8_t *)sub->rects[i]->ass)) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
"Invalid UTF-8 in decoded subtitles text; "
|
"Invalid UTF-8 in decoded subtitles text; "
|
||||||
"maybe missing -sub_charenc option\n");
|
"maybe missing -sub_charenc option\n");
|
||||||
|
@ -3011,6 +3012,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
|
||||||
return blocks * ((ba - 4 * ch) * 2 / ch);
|
return blocks * ((ba - 4 * ch) * 2 / ch);
|
||||||
case AV_CODEC_ID_ADPCM_MS:
|
case AV_CODEC_ID_ADPCM_MS:
|
||||||
return blocks * (2 + (ba - 7 * ch) * 2 / ch);
|
return blocks * (2 + (ba - 7 * ch) * 2 / ch);
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3027,6 +3029,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
|
||||||
return frame_bytes / ((FFALIGN(ch, 2) * bps) / 8);
|
return frame_bytes / ((FFALIGN(ch, 2) * bps) / 8);
|
||||||
case AV_CODEC_ID_S302M:
|
case AV_CODEC_ID_S302M:
|
||||||
return 2 * (frame_bytes / ((bps + 4) / 4)) / ch;
|
return 2 * (frame_bytes / ((bps + 4) / 4)) / ch;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3286,7 +3289,7 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
|
||||||
ret = av_bprint_finalize(buf, &str);
|
ret = av_bprint_finalize(buf, &str);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
avctx->extradata = str;
|
avctx->extradata = (uint8_t *) str;
|
||||||
/* Note: the string is NUL terminated (so extradata can be read as a
|
/* Note: the string is NUL terminated (so extradata can be read as a
|
||||||
* string), but the ending character is not accounted in the size (in
|
* string), but the ending character is not accounted in the size (in
|
||||||
* binary formats you are likely not supposed to mux that character). When
|
* binary formats you are likely not supposed to mux that character). When
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "libavutil/attributes.h"
|
#include "libavutil/attributes.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
|
#include "libavutil/internal.h"
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
@ -676,7 +677,7 @@ static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred)
|
||||||
for (i = 0; i < ich; i++)
|
for (i = 0; i < ich; i++)
|
||||||
pred[ich] += s->channel_residues[i][icoef] *
|
pred[ich] += s->channel_residues[i][icoef] *
|
||||||
s->mclms_coeffs_cur[i + num_channels * ich];
|
s->mclms_coeffs_cur[i + num_channels * ich];
|
||||||
pred[ich] += 1 << s->mclms_scaling - 1;
|
pred[ich] += 1 << (s->mclms_scaling - 1);
|
||||||
pred[ich] >>= s->mclms_scaling;
|
pred[ich] >>= s->mclms_scaling;
|
||||||
s->channel_residues[ich][icoef] += pred[ich];
|
s->channel_residues[ich][icoef] += pred[ich];
|
||||||
}
|
}
|
||||||
|
@ -708,7 +709,7 @@ static void lms_update(WmallDecodeCtx *s, int ich, int ilms,
|
||||||
{
|
{
|
||||||
int icoef;
|
int icoef;
|
||||||
int recent = s->cdlms[ich][ilms].recent;
|
int recent = s->cdlms[ich][ilms].recent;
|
||||||
int range = 1 << s->bits_per_sample - 1;
|
int range = 1 << (s->bits_per_sample - 1);
|
||||||
|
|
||||||
if (residue < 0) {
|
if (residue < 0) {
|
||||||
for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
|
for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
|
||||||
|
|
|
@ -89,6 +89,7 @@
|
||||||
#include "libavutil/float_dsp.h"
|
#include "libavutil/float_dsp.h"
|
||||||
#include "libavutil/intfloat.h"
|
#include "libavutil/intfloat.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
|
#include "libavutil/internal.h"
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "get_bits.h"
|
#include "get_bits.h"
|
||||||
|
|
|
@ -229,7 +229,7 @@ static int asf_read_picture(AVFormatContext *s, int len)
|
||||||
desc = av_malloc(desc_len);
|
desc = av_malloc(desc_len);
|
||||||
if (!desc)
|
if (!desc)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
len -= avio_get_str16le(s->pb, len - picsize, desc, desc_len);
|
len -= avio_get_str16le(s->pb, len - picsize, (char *) desc, desc_len);
|
||||||
|
|
||||||
ret = av_get_packet(s->pb, &pkt, picsize);
|
ret = av_get_packet(s->pb, &pkt, picsize);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -248,11 +248,11 @@ static int asf_read_picture(AVFormatContext *s, int len)
|
||||||
st->attached_pic.flags |= AV_PKT_FLAG_KEY;
|
st->attached_pic.flags |= AV_PKT_FLAG_KEY;
|
||||||
|
|
||||||
if (*desc)
|
if (*desc)
|
||||||
av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL);
|
av_dict_set(&st->metadata, "title", (char *) desc, AV_DICT_DONT_STRDUP_VAL);
|
||||||
else
|
else
|
||||||
av_freep(&desc);
|
av_freep(&desc);
|
||||||
|
|
||||||
av_dict_set(&st->metadata, "comment", ff_id3v2_picture_types[type], 0);
|
av_dict_set(&st->metadata, "comment", (const char *) ff_id3v2_picture_types[type], 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ static void get_tag(AVFormatContext *s, const char *key, int type, int len, int
|
||||||
if (type == 0) { // UTF16-LE
|
if (type == 0) { // UTF16-LE
|
||||||
avio_get_str16le(s->pb, len, value, 2 * len + 1);
|
avio_get_str16le(s->pb, len, value, 2 * len + 1);
|
||||||
} else if (type == -1) { // ASCII
|
} else if (type == -1) { // ASCII
|
||||||
avio_read(s->pb, value, len);
|
avio_read(s->pb, (unsigned char *) value, len);
|
||||||
value[len]=0;
|
value[len]=0;
|
||||||
} else if (type == 1) { // byte array
|
} else if (type == 1) { // byte array
|
||||||
if (!strcmp(key, "WM/Picture")) { // handle cover art
|
if (!strcmp(key, "WM/Picture")) { // handle cover art
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include "libavutil/channel_layout.h"
|
#include "libavutil/channel_layout.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
|
#include "libavutil/internal.h"
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "ast.h"
|
#include "ast.h"
|
||||||
|
|
|
@ -1657,7 +1657,7 @@ int av_find_best_stream(AVFormatContext *ic,
|
||||||
enum AVMediaType type,
|
enum AVMediaType type,
|
||||||
int wanted_stream_nb,
|
int wanted_stream_nb,
|
||||||
int related_stream,
|
int related_stream,
|
||||||
AVCodec **decoder_ret,
|
const AVCodec **decoder_ret,
|
||||||
int flags);
|
int flags);
|
||||||
|
|
||||||
#if FF_API_READ_PACKET
|
#if FF_API_READ_PACKET
|
||||||
|
|
|
@ -135,10 +135,10 @@ static int get_riff(AVFormatContext *s, AVIOContext *pb)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* check RIFF header */
|
/* check RIFF header */
|
||||||
avio_read(pb, header, 4);
|
avio_read(pb, (unsigned char *)header, 4);
|
||||||
avi->riff_end = avio_rl32(pb); /* RIFF chunk size */
|
avi->riff_end = avio_rl32(pb); /* RIFF chunk size */
|
||||||
avi->riff_end += avio_tell(pb); /* RIFF chunk end */
|
avi->riff_end += avio_tell(pb); /* RIFF chunk end */
|
||||||
avio_read(pb, header + 4, 4);
|
avio_read(pb, (unsigned char *)header + 4, 4);
|
||||||
|
|
||||||
for (i = 0; avi_headers[i][0]; i++)
|
for (i = 0; avi_headers[i][0]; i++)
|
||||||
if (!memcmp(header, avi_headers[i], 8))
|
if (!memcmp(header, avi_headers[i], 8))
|
||||||
|
@ -303,7 +303,7 @@ static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag,
|
||||||
value = av_malloc(size + 1);
|
value = av_malloc(size + 1);
|
||||||
if (!value)
|
if (!value)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
avio_read(pb, value, size);
|
avio_read(pb, (unsigned char *)value, size);
|
||||||
value[size] = 0;
|
value[size] = 0;
|
||||||
|
|
||||||
AV_WL32(key, tag);
|
AV_WL32(key, tag);
|
||||||
|
@ -348,7 +348,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end)
|
||||||
uint16_t size = avio_rl16(s->pb);
|
uint16_t size = avio_rl16(s->pb);
|
||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
char buffer[64] = { 0 };
|
char buffer[64] = { 0 };
|
||||||
size -= avio_read(s->pb, buffer,
|
size -= avio_read(s->pb, (unsigned char *)buffer,
|
||||||
FFMIN(size, sizeof(buffer) - 1));
|
FFMIN(size, sizeof(buffer) - 1));
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case 0x03:
|
case 0x03:
|
||||||
|
@ -444,7 +444,7 @@ static int avi_read_header(AVFormatContext *s)
|
||||||
size += (size & 1);
|
size += (size & 1);
|
||||||
size -= avio_read(pb, date, FFMIN(size, sizeof(date) - 1));
|
size -= avio_read(pb, date, FFMIN(size, sizeof(date) - 1));
|
||||||
avio_skip(pb, size);
|
avio_skip(pb, size);
|
||||||
avi_metadata_creation_time(&s->metadata, date);
|
avi_metadata_creation_time(&s->metadata, (char *)date);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MKTAG('d', 'm', 'l', 'h'):
|
case MKTAG('d', 'm', 'l', 'h'):
|
||||||
|
@ -747,9 +747,9 @@ static int avi_read_header(AVFormatContext *s)
|
||||||
av_log(s, AV_LOG_DEBUG, "overriding invalid dshow_block_align of %d\n", ast->dshow_block_align);
|
av_log(s, AV_LOG_DEBUG, "overriding invalid dshow_block_align of %d\n", ast->dshow_block_align);
|
||||||
ast->dshow_block_align = 0;
|
ast->dshow_block_align = 0;
|
||||||
}
|
}
|
||||||
if (st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align == 1024 && ast->sample_size == 1024 ||
|
if ((st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align == 1024 && ast->sample_size == 1024) ||
|
||||||
st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align == 4096 && ast->sample_size == 4096 ||
|
(st->codec->codec_id == AV_CODEC_ID_AAC && ast->dshow_block_align == 4096 && ast->sample_size == 4096) ||
|
||||||
st->codec->codec_id == AV_CODEC_ID_MP3 && ast->dshow_block_align == 1152 && ast->sample_size == 1152) {
|
(st->codec->codec_id == AV_CODEC_ID_MP3 && ast->dshow_block_align == 1152 && ast->sample_size == 1152)) {
|
||||||
av_log(s, AV_LOG_DEBUG, "overriding sample_size\n");
|
av_log(s, AV_LOG_DEBUG, "overriding sample_size\n");
|
||||||
ast->sample_size = 0;
|
ast->sample_size = 0;
|
||||||
}
|
}
|
||||||
|
@ -906,7 +906,7 @@ fail:
|
||||||
static int read_gab2_sub(AVStream *st, AVPacket *pkt)
|
static int read_gab2_sub(AVStream *st, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
if (pkt->size >= 7 &&
|
if (pkt->size >= 7 &&
|
||||||
!strcmp(pkt->data, "GAB2") && AV_RL16(pkt->data + 5) == 2) {
|
!strcmp((char *)pkt->data, "GAB2") && AV_RL16(pkt->data + 5) == 2) {
|
||||||
uint8_t desc[256];
|
uint8_t desc[256];
|
||||||
int score = AVPROBE_SCORE_EXTENSION, ret;
|
int score = AVPROBE_SCORE_EXTENSION, ret;
|
||||||
AVIStream *ast = st->priv_data;
|
AVIStream *ast = st->priv_data;
|
||||||
|
@ -921,10 +921,10 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt)
|
||||||
if (desc_len > pb->buf_end - pb->buf_ptr)
|
if (desc_len > pb->buf_end - pb->buf_ptr)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
ret = avio_get_str16le(pb, desc_len, desc, sizeof(desc));
|
ret = avio_get_str16le(pb, desc_len, (char *)desc, sizeof(desc));
|
||||||
avio_skip(pb, desc_len - ret);
|
avio_skip(pb, desc_len - ret);
|
||||||
if (*desc)
|
if (*desc)
|
||||||
av_dict_set(&st->metadata, "title", desc, 0);
|
av_dict_set(&st->metadata, "title", (const char *)desc, 0);
|
||||||
|
|
||||||
avio_rl16(pb); /* flags? */
|
avio_rl16(pb); /* flags? */
|
||||||
avio_rl32(pb); /* data size */
|
avio_rl32(pb); /* data size */
|
||||||
|
|
|
@ -64,7 +64,7 @@ static const AVClass *urlcontext_child_class_next(const AVClass *prev)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* find next protocol with priv options */
|
/* find next protocol with priv options */
|
||||||
while (p = ffurl_protocol_next(p))
|
while ((p = ffurl_protocol_next(p)))
|
||||||
if (p->priv_data_class)
|
if (p->priv_data_class)
|
||||||
return p->priv_data_class;
|
return p->priv_data_class;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -220,8 +220,8 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
|
||||||
"Missing call to av_register_all()?\n");
|
"Missing call to av_register_all()?\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename[proto_len] != ':' &&
|
if ((filename[proto_len] != ':' &&
|
||||||
(filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) ||
|
(filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':'))) ||
|
||||||
is_dos_path(filename))
|
is_dos_path(filename))
|
||||||
strcpy(proto_str, "file");
|
strcpy(proto_str, "file");
|
||||||
else
|
else
|
||||||
|
@ -233,7 +233,7 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
|
||||||
if ((ptr = strchr(proto_nested, '+')))
|
if ((ptr = strchr(proto_nested, '+')))
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
|
||||||
while (up = ffurl_protocol_next(up)) {
|
while ((up = ffurl_protocol_next(up))) {
|
||||||
if (!strcmp(proto_str, up->name))
|
if (!strcmp(proto_str, up->name))
|
||||||
return url_alloc_for_protocol (puc, up, filename, flags, int_cb);
|
return url_alloc_for_protocol (puc, up, filename, flags, int_cb);
|
||||||
if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
|
if (up->flags & URL_PROTOCOL_FLAG_NESTED_SCHEME &&
|
||||||
|
|
|
@ -317,7 +317,7 @@ int avio_put_str(AVIOContext *s, const char *str)
|
||||||
|
|
||||||
int avio_put_str16le(AVIOContext *s, const char *str)
|
int avio_put_str16le(AVIOContext *s, const char *str)
|
||||||
{
|
{
|
||||||
const uint8_t *q = str;
|
const uint8_t *q = (const uint8_t *) str;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
while (*q) {
|
while (*q) {
|
||||||
|
@ -891,7 +891,7 @@ int avio_printf(AVIOContext *s, const char *fmt, ...)
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
ret = vsnprintf(buf, sizeof(buf), fmt, ap);
|
ret = vsnprintf(buf, sizeof(buf), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
avio_write(s, buf, strlen(buf));
|
avio_write(s, (const unsigned char *) buf, strlen(buf));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1036,7 +1036,7 @@ int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
|
||||||
|
|
||||||
/* don't attempt to pad fixed-size packet buffers */
|
/* don't attempt to pad fixed-size packet buffers */
|
||||||
if (!s->max_packet_size) {
|
if (!s->max_packet_size) {
|
||||||
avio_write(s, padbuf, sizeof(padbuf));
|
avio_write(s, (const unsigned char *) padbuf, sizeof(padbuf));
|
||||||
padding = FF_INPUT_BUFFER_PADDING_SIZE;
|
padding = FF_INPUT_BUFFER_PADDING_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -289,13 +289,13 @@ static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(strcmp(key, "TCON") && strcmp(key, "TCO")) &&
|
if (!(strcmp(key, "TCON") && strcmp(key, "TCO")) &&
|
||||||
(sscanf(dst, "(%d)", &genre) == 1 || sscanf(dst, "%d", &genre) == 1) &&
|
(sscanf((const char *) dst, "(%d)", &genre) == 1 || sscanf((const char *) dst, "%d", &genre) == 1) &&
|
||||||
genre <= ID3v1_GENRE_MAX) {
|
genre <= ID3v1_GENRE_MAX) {
|
||||||
av_freep(&dst);
|
av_freep(&dst);
|
||||||
dst = av_strdup(ff_id3v1_genre_str[genre]);
|
dst = (uint8_t *) av_strdup(ff_id3v1_genre_str[genre]);
|
||||||
} else if (!(strcmp(key, "TXXX") && strcmp(key, "TXX"))) {
|
} else if (!(strcmp(key, "TXXX") && strcmp(key, "TXX"))) {
|
||||||
/* dst now contains the key, need to get value */
|
/* dst now contains the key, need to get value */
|
||||||
key = dst;
|
key = (const char *) dst;
|
||||||
if (decode_str(s, pb, encoding, &dst, &taglen) < 0) {
|
if (decode_str(s, pb, encoding, &dst, &taglen) < 0) {
|
||||||
av_log(s, AV_LOG_ERROR, "Error reading frame %s, skipped\n", key);
|
av_log(s, AV_LOG_ERROR, "Error reading frame %s, skipped\n", key);
|
||||||
av_freep(&key);
|
av_freep(&key);
|
||||||
|
@ -306,7 +306,7 @@ static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen,
|
||||||
av_freep(&dst);
|
av_freep(&dst);
|
||||||
|
|
||||||
if (dst)
|
if (dst)
|
||||||
av_dict_set(metadata, key, dst, dict_flags);
|
av_dict_set(metadata, key, (const char *) dst, dict_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -536,7 +536,7 @@ static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *tta
|
||||||
end = avio_rb32(pb);
|
end = avio_rb32(pb);
|
||||||
avio_skip(pb, 8);
|
avio_skip(pb, 8);
|
||||||
|
|
||||||
chapter = avpriv_new_chapter(s, s->nb_chapters + 1, time_base, start, end, dst);
|
chapter = avpriv_new_chapter(s, s->nb_chapters + 1, time_base, start, end, (const char *) dst);
|
||||||
if (!chapter) {
|
if (!chapter) {
|
||||||
av_free(dst);
|
av_free(dst);
|
||||||
return;
|
return;
|
||||||
|
@ -544,7 +544,7 @@ static void read_chapter(AVFormatContext *s, AVIOContext *pb, int len, char *tta
|
||||||
|
|
||||||
len -= 16;
|
len -= 16;
|
||||||
while (len > 10) {
|
while (len > 10) {
|
||||||
avio_read(pb, tag, 4);
|
avio_read(pb, (unsigned char *) tag, 4);
|
||||||
tag[4] = 0;
|
tag[4] = 0;
|
||||||
taglen = avio_rb32(pb);
|
taglen = avio_rb32(pb);
|
||||||
avio_skip(pb, 2);
|
avio_skip(pb, 2);
|
||||||
|
@ -667,7 +667,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
|
||||||
unsigned long dlen;
|
unsigned long dlen;
|
||||||
|
|
||||||
if (isv34) {
|
if (isv34) {
|
||||||
avio_read(s->pb, tag, 4);
|
avio_read(s->pb, (unsigned char *) tag, 4);
|
||||||
tag[4] = 0;
|
tag[4] = 0;
|
||||||
if (version == 3) {
|
if (version == 3) {
|
||||||
tlen = avio_rb32(s->pb);
|
tlen = avio_rb32(s->pb);
|
||||||
|
@ -676,7 +676,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
|
||||||
tflags = avio_rb16(s->pb);
|
tflags = avio_rb16(s->pb);
|
||||||
tunsync = tflags & ID3v2_FLAG_UNSYNCH;
|
tunsync = tflags & ID3v2_FLAG_UNSYNCH;
|
||||||
} else {
|
} else {
|
||||||
avio_read(s->pb, tag, 3);
|
avio_read(s->pb, (unsigned char *) tag, 3);
|
||||||
tag[3] = 0;
|
tag[3] = 0;
|
||||||
tlen = avio_rb24(s->pb);
|
tlen = avio_rb24(s->pb);
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
|
||||||
pbx = s->pb;
|
pbx = s->pb;
|
||||||
|
|
||||||
if (unsync || tunsync || tcomp) {
|
if (unsync || tunsync || tcomp) {
|
||||||
av_fast_malloc(&buffer, &buffer_size, tlen);
|
av_fast_malloc(&buffer, (unsigned int *) &buffer_size, tlen);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
av_log(s, AV_LOG_ERROR, "Failed to alloc %d bytes\n", tlen);
|
av_log(s, AV_LOG_ERROR, "Failed to alloc %d bytes\n", tlen);
|
||||||
goto seek;
|
goto seek;
|
||||||
|
@ -758,7 +758,7 @@ static void id3v2_parse(AVFormatContext *s, int len, uint8_t version,
|
||||||
|
|
||||||
av_log(s, AV_LOG_DEBUG, "Compresssed frame %s tlen=%d dlen=%ld\n", tag, tlen, dlen);
|
av_log(s, AV_LOG_DEBUG, "Compresssed frame %s tlen=%d dlen=%ld\n", tag, tlen, dlen);
|
||||||
|
|
||||||
av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen);
|
av_fast_malloc(&uncompressed_buffer, (unsigned int *) &uncompressed_buffer_size, dlen);
|
||||||
if (!uncompressed_buffer) {
|
if (!uncompressed_buffer) {
|
||||||
av_log(s, AV_LOG_ERROR, "Failed to alloc %ld bytes\n", dlen);
|
av_log(s, AV_LOG_ERROR, "Failed to alloc %ld bytes\n", dlen);
|
||||||
goto seek;
|
goto seek;
|
||||||
|
@ -880,7 +880,7 @@ int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
|
||||||
st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
|
st->disposition |= AV_DISPOSITION_ATTACHED_PIC;
|
||||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
st->codec->codec_id = apic->id;
|
st->codec->codec_id = apic->id;
|
||||||
av_dict_set(&st->metadata, "title", apic->description, 0);
|
av_dict_set(&st->metadata, "title", (const char *) apic->description, 0);
|
||||||
av_dict_set(&st->metadata, "comment", apic->type, 0);
|
av_dict_set(&st->metadata, "comment", apic->type, 0);
|
||||||
|
|
||||||
av_init_packet(&st->attached_pic);
|
av_init_packet(&st->attached_pic);
|
||||||
|
|
|
@ -288,6 +288,7 @@ static int init_muxer(AVFormatContext *s, AVDictionary **options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (of->codec_tag) {
|
if (of->codec_tag) {
|
||||||
|
@ -388,7 +389,7 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (ret = init_muxer(s, options))
|
if ((ret = init_muxer(s, options)))
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (s->oformat->write_header) {
|
if (s->oformat->write_header) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ static void *format_child_next(void *obj, void *prev)
|
||||||
AVFormatContext *s = obj;
|
AVFormatContext *s = obj;
|
||||||
if (!prev && s->priv_data &&
|
if (!prev && s->priv_data &&
|
||||||
((s->iformat && s->iformat->priv_class) ||
|
((s->iformat && s->iformat->priv_class) ||
|
||||||
s->oformat && s->oformat->priv_class))
|
(s->oformat && s->oformat->priv_class)))
|
||||||
return s->priv_data;
|
return s->priv_data;
|
||||||
if (s->pb && s->pb->av_class && prev != s->pb)
|
if (s->pb && s->pb->av_class && prev != s->pb)
|
||||||
return s->pb;
|
return s->pb;
|
||||||
|
@ -65,11 +65,11 @@ static const AVClass *format_child_class_next(const AVClass *prev)
|
||||||
if (ofmt->priv_class == prev)
|
if (ofmt->priv_class == prev)
|
||||||
break;
|
break;
|
||||||
if (!ofmt)
|
if (!ofmt)
|
||||||
while (ifmt = av_iformat_next(ifmt))
|
while ((ifmt = av_iformat_next(ifmt)))
|
||||||
if (ifmt->priv_class)
|
if (ifmt->priv_class)
|
||||||
return ifmt->priv_class;
|
return ifmt->priv_class;
|
||||||
|
|
||||||
while (ofmt = av_oformat_next(ofmt))
|
while ((ofmt = av_oformat_next(ofmt)))
|
||||||
if (ofmt->priv_class)
|
if (ofmt->priv_class)
|
||||||
return ofmt->priv_class;
|
return ofmt->priv_class;
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
|
||||||
|
|
||||||
AV_WL32(key, chunk_code);
|
AV_WL32(key, chunk_code);
|
||||||
|
|
||||||
if (avio_read(pb, value, chunk_size) != chunk_size) {
|
if (avio_read(pb, (unsigned char *)value, chunk_size) != chunk_size) {
|
||||||
av_log(s, AV_LOG_WARNING,
|
av_log(s, AV_LOG_WARNING,
|
||||||
"premature end of file while reading INFO tag\n");
|
"premature end of file while reading INFO tag\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,7 @@ static int64_t wrap_timestamp(AVStream *st, int64_t timestamp)
|
||||||
|
|
||||||
MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate)
|
MAKE_ACCESSORS(AVStream, stream, AVRational, r_frame_rate)
|
||||||
|
|
||||||
static AVCodec *find_decoder(AVStream *st, enum AVCodecID codec_id)
|
static const AVCodec *find_decoder(AVStream *st, enum AVCodecID codec_id)
|
||||||
{
|
{
|
||||||
if (st->codec->codec)
|
if (st->codec->codec)
|
||||||
return st->codec->codec;
|
return st->codec->codec;
|
||||||
|
@ -215,7 +215,7 @@ AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score
|
||||||
const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
|
const static uint8_t zerobuffer[AVPROBE_PADDING_SIZE];
|
||||||
|
|
||||||
if (!lpd.buf)
|
if (!lpd.buf)
|
||||||
lpd.buf = zerobuffer;
|
lpd.buf = (unsigned char *) zerobuffer;
|
||||||
|
|
||||||
if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
|
if (lpd.buf_size > 10 && ff_id3v2_match(lpd.buf, ID3v2_DEFAULT_MAGIC)) {
|
||||||
int id3len = ff_id3v2_tag_len(lpd.buf);
|
int id3len = ff_id3v2_tag_len(lpd.buf);
|
||||||
|
@ -347,7 +347,7 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*fmt && pb->av_class && av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type) >= 0 && mime_type) {
|
if (!*fmt && pb->av_class && av_opt_get(pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type) >= 0 && mime_type) {
|
||||||
if (!av_strcasecmp(mime_type, "audio/aacp")) {
|
if (!av_strcasecmp((const char *) mime_type, "audio/aacp")) {
|
||||||
*fmt = av_find_input_format("aac");
|
*fmt = av_find_input_format("aac");
|
||||||
}
|
}
|
||||||
av_freep(&mime_type);
|
av_freep(&mime_type);
|
||||||
|
@ -579,6 +579,7 @@ static void force_codec_ids(AVFormatContext *s, AVStream *st)
|
||||||
case AVMEDIA_TYPE_SUBTITLE:
|
case AVMEDIA_TYPE_SUBTITLE:
|
||||||
if(s->subtitle_codec_id)st->codec->codec_id= s->subtitle_codec_id;
|
if(s->subtitle_codec_id)st->codec->codec_id= s->subtitle_codec_id;
|
||||||
break;
|
break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -859,7 +860,7 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
|
||||||
// reference time stamp should be 60 s before first time stamp
|
// reference time stamp should be 60 s before first time stamp
|
||||||
int64_t pts_wrap_reference = st->first_dts - av_rescale(60, st->time_base.den, st->time_base.num);
|
int64_t pts_wrap_reference = st->first_dts - av_rescale(60, st->time_base.den, st->time_base.num);
|
||||||
// if first time stamp is not more than 1/8 and 60s before the wrap point, subtract rather than add wrap offset
|
// if first time stamp is not more than 1/8 and 60s before the wrap point, subtract rather than add wrap offset
|
||||||
int pts_wrap_behavior = (st->first_dts < (1LL<<st->pts_wrap_bits) - (1LL<<st->pts_wrap_bits-3)) ||
|
int pts_wrap_behavior = (st->first_dts < (1LL<<st->pts_wrap_bits) - (1LL<<(st->pts_wrap_bits-3))) ||
|
||||||
(st->first_dts < (1LL<<st->pts_wrap_bits) - av_rescale(60, st->time_base.den, st->time_base.num)) ?
|
(st->first_dts < (1LL<<st->pts_wrap_bits) - av_rescale(60, st->time_base.den, st->time_base.num)) ?
|
||||||
AV_PTS_WRAP_ADD_OFFSET : AV_PTS_WRAP_SUB_OFFSET;
|
AV_PTS_WRAP_ADD_OFFSET : AV_PTS_WRAP_SUB_OFFSET;
|
||||||
|
|
||||||
|
@ -2431,6 +2432,8 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr)
|
||||||
break;
|
break;
|
||||||
case AVMEDIA_TYPE_DATA:
|
case AVMEDIA_TYPE_DATA:
|
||||||
if(avctx->codec_id == AV_CODEC_ID_NONE) return 1;
|
if(avctx->codec_id == AV_CODEC_ID_NONE) return 1;
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->codec_id == AV_CODEC_ID_NONE)
|
if (avctx->codec_id == AV_CODEC_ID_NONE)
|
||||||
|
@ -3068,6 +3071,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
||||||
st->disposition = AV_DISPOSITION_COMMENT; break;
|
st->disposition = AV_DISPOSITION_COMMENT; break;
|
||||||
case AV_AUDIO_SERVICE_TYPE_KARAOKE:
|
case AV_AUDIO_SERVICE_TYPE_KARAOKE:
|
||||||
st->disposition = AV_DISPOSITION_KARAOKE; break;
|
st->disposition = AV_DISPOSITION_KARAOKE; break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3129,13 +3133,13 @@ int av_find_best_stream(AVFormatContext *ic,
|
||||||
enum AVMediaType type,
|
enum AVMediaType type,
|
||||||
int wanted_stream_nb,
|
int wanted_stream_nb,
|
||||||
int related_stream,
|
int related_stream,
|
||||||
AVCodec **decoder_ret,
|
const AVCodec **decoder_ret,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
int i, nb_streams = ic->nb_streams;
|
int i, nb_streams = ic->nb_streams;
|
||||||
int ret = AVERROR_STREAM_NOT_FOUND, best_count = -1, best_bitrate = -1, best_multiframe = -1, count, bitrate, multiframe;
|
int ret = AVERROR_STREAM_NOT_FOUND, best_count = -1, best_bitrate = -1, best_multiframe = -1, count, bitrate, multiframe;
|
||||||
unsigned *program = NULL;
|
unsigned *program = NULL;
|
||||||
AVCodec *decoder = NULL, *best_decoder = NULL;
|
const AVCodec *decoder = NULL, *best_decoder = NULL;
|
||||||
|
|
||||||
if (related_stream >= 0 && wanted_stream_nb < 0) {
|
if (related_stream >= 0 && wanted_stream_nb < 0) {
|
||||||
AVProgram *p = av_find_program_from_stream(ic, NULL, related_stream);
|
AVProgram *p = av_find_program_from_stream(ic, NULL, related_stream);
|
||||||
|
@ -3378,7 +3382,7 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
|
||||||
program = av_mallocz(sizeof(AVProgram));
|
program = av_mallocz(sizeof(AVProgram));
|
||||||
if (!program)
|
if (!program)
|
||||||
return NULL;
|
return NULL;
|
||||||
dynarray_add(&ac->programs, &ac->nb_programs, program);
|
dynarray_add(&ac->programs, (int *) &ac->nb_programs, program);
|
||||||
program->discard = AVDISCARD_NONE;
|
program->discard = AVDISCARD_NONE;
|
||||||
}
|
}
|
||||||
program->id = id;
|
program->id = id;
|
||||||
|
@ -3404,7 +3408,7 @@ AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base,
|
||||||
chapter= av_mallocz(sizeof(AVChapter));
|
chapter= av_mallocz(sizeof(AVChapter));
|
||||||
if(!chapter)
|
if(!chapter)
|
||||||
return NULL;
|
return NULL;
|
||||||
dynarray_add(&s->chapters, &s->nb_chapters, chapter);
|
dynarray_add(&s->chapters, (int *) &s->nb_chapters, chapter);
|
||||||
}
|
}
|
||||||
av_dict_set(&chapter->metadata, "title", title, 0);
|
av_dict_set(&chapter->metadata, "title", title, 0);
|
||||||
chapter->id = id;
|
chapter->id = id;
|
||||||
|
|
|
@ -147,7 +147,7 @@ static inline int wav_parse_bext_string(AVFormatContext *s, const char *key,
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
av_assert0(length <= sizeof(temp));
|
av_assert0(length <= sizeof(temp));
|
||||||
if ((ret = avio_read(s->pb, temp, length)) < 0)
|
if ((ret = avio_read(s->pb, (unsigned char *) temp, length)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
temp[length] = 0;
|
temp[length] = 0;
|
||||||
|
@ -217,7 +217,7 @@ static int wav_parse_bext_tag(AVFormatContext *s, int64_t size)
|
||||||
if (!(coding_history = av_malloc(size + 1)))
|
if (!(coding_history = av_malloc(size + 1)))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
if ((ret = avio_read(s->pb, coding_history, size)) < 0)
|
if ((ret = avio_read(s->pb, (unsigned char *) coding_history, size)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
coding_history[size] = 0;
|
coding_history[size] = 0;
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
#include "libavutil/internal.h"
|
||||||
#include "riff.h"
|
#include "riff.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
* scheduled for removal.
|
* scheduled for removal.
|
||||||
*/
|
*/
|
||||||
#ifndef AV_NOWARN_DEPRECATED
|
#ifndef AV_NOWARN_DEPRECATED
|
||||||
#if AV_GCC_VERSION_AT_LEAST(4,6)
|
#if AV_GCC_VERSION_AT_LEAST(4,6) || defined(__clang__)
|
||||||
# define AV_NOWARN_DEPRECATED(code) \
|
# define AV_NOWARN_DEPRECATED(code) \
|
||||||
_Pragma("GCC diagnostic push") \
|
_Pragma("GCC diagnostic push") \
|
||||||
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
|
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
|
||||||
|
|
|
@ -221,7 +221,7 @@ void av_bprint_get_buffer(AVBPrint *buf, unsigned size,
|
||||||
if (size > av_bprint_room(buf))
|
if (size > av_bprint_room(buf))
|
||||||
av_bprint_alloc(buf, size);
|
av_bprint_alloc(buf, size);
|
||||||
*actual_size = av_bprint_room(buf);
|
*actual_size = av_bprint_room(buf);
|
||||||
*mem = *actual_size ? buf->str + buf->len : NULL;
|
*mem = *actual_size ? (unsigned char *)buf->str + buf->len : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void av_bprint_clear(AVBPrint *buf)
|
void av_bprint_clear(AVBPrint *buf)
|
||||||
|
|
|
@ -193,7 +193,7 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
|
||||||
};
|
};
|
||||||
const AVClass *pclass = &class;
|
const AVClass *pclass = &class;
|
||||||
|
|
||||||
return av_opt_eval_flags(&pclass, &cpuflags_opts[0], s, flags);
|
return av_opt_eval_flags(&pclass, &cpuflags_opts[0], s, (int *) flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
int av_cpu_count(void)
|
int av_cpu_count(void)
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "eval.h"
|
#include "eval.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "mathematics.h"
|
#include "mathematics.h"
|
||||||
#include "time.h"
|
#include "time_.h"
|
||||||
#include "avstring.h"
|
#include "avstring.h"
|
||||||
|
|
||||||
typedef struct Parser {
|
typedef struct Parser {
|
||||||
|
@ -237,7 +237,9 @@ static double eval_expr(Parser *p, AVExpr *e)
|
||||||
double x_max = eval_expr(p, e->param[1]);
|
double x_max = eval_expr(p, e->param[1]);
|
||||||
for(i=-1; i<1024; i++) {
|
for(i=-1; i<1024; i++) {
|
||||||
if(i<255) {
|
if(i<255) {
|
||||||
|
AV_NOWARN_DEPRECATED(
|
||||||
p->var[0] = av_reverse[i&255]*x_max/255;
|
p->var[0] = av_reverse[i&255]*x_max/255;
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
p->var[0] = x_max*pow(0.9, i-255);
|
p->var[0] = x_max*pow(0.9, i-255);
|
||||||
if (i&1) p->var[0] *= -1;
|
if (i&1) p->var[0] *= -1;
|
||||||
|
@ -294,6 +296,7 @@ static double eval_expr(Parser *p, AVExpr *e)
|
||||||
case e_hypot:return e->value * (sqrt(d*d + d2*d2));
|
case e_hypot:return e->value * (sqrt(d*d + d2*d2));
|
||||||
case e_bitand: return isnan(d) || isnan(d2) ? NAN : e->value * ((long int)d & (long int)d2);
|
case e_bitand: return isnan(d) || isnan(d2) ? NAN : e->value * ((long int)d & (long int)d2);
|
||||||
case e_bitor: return isnan(d) || isnan(d2) ? NAN : e->value * ((long int)d | (long int)d2);
|
case e_bitor: return isnan(d) || isnan(d2) ? NAN : e->value * ((long int)d | (long int)d2);
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,22 +53,26 @@ int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int qp_type)
|
||||||
|
|
||||||
f->qp_table_buf = buf;
|
f->qp_table_buf = buf;
|
||||||
|
|
||||||
f->qscale_table = buf->data;
|
AV_NOWARN_DEPRECATED(
|
||||||
|
f->qscale_table = (int8_t *) buf->data;
|
||||||
f->qstride = stride;
|
f->qstride = stride;
|
||||||
f->qscale_type = qp_type;
|
f->qscale_type = qp_type;
|
||||||
|
);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
|
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
|
||||||
{
|
{
|
||||||
|
AV_NOWARN_DEPRECATED(
|
||||||
*stride = f->qstride;
|
*stride = f->qstride;
|
||||||
*type = f->qscale_type;
|
*type = f->qscale_type;
|
||||||
|
);
|
||||||
|
|
||||||
if (!f->qp_table_buf)
|
if (!f->qp_table_buf)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return f->qp_table_buf->data;
|
return (int8_t *) f->qp_table_buf->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *av_get_colorspace_name(enum AVColorSpace val)
|
const char *av_get_colorspace_name(enum AVColorSpace val)
|
||||||
|
@ -272,7 +276,7 @@ int av_frame_ref(AVFrame *dst, AVFrame *src)
|
||||||
av_samples_copy(dst->extended_data, src->extended_data, 0, 0,
|
av_samples_copy(dst->extended_data, src->extended_data, 0, 0,
|
||||||
dst->nb_samples, ch, dst->format);
|
dst->nb_samples, ch, dst->format);
|
||||||
} else {
|
} else {
|
||||||
av_image_copy(dst->data, dst->linesize, src->data, src->linesize,
|
av_image_copy(dst->data, dst->linesize, (const uint8_t **) src->data, src->linesize,
|
||||||
dst->format, dst->width, dst->height);
|
dst->format, dst->width, dst->height);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -425,7 +429,7 @@ int av_frame_make_writable(AVFrame *frame)
|
||||||
av_samples_copy(tmp.extended_data, frame->extended_data, 0, 0,
|
av_samples_copy(tmp.extended_data, frame->extended_data, 0, 0,
|
||||||
frame->nb_samples, ch, frame->format);
|
frame->nb_samples, ch, frame->format);
|
||||||
} else {
|
} else {
|
||||||
av_image_copy(tmp.data, tmp.linesize, frame->data, frame->linesize,
|
av_image_copy(tmp.data, tmp.linesize, (const uint8_t **) frame->data, frame->linesize,
|
||||||
frame->format, frame->width, frame->height);
|
frame->format, frame->width, frame->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,7 +463,9 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
|
||||||
dst->sample_rate = src->sample_rate;
|
dst->sample_rate = src->sample_rate;
|
||||||
dst->opaque = src->opaque;
|
dst->opaque = src->opaque;
|
||||||
#if FF_API_AVFRAME_LAVC
|
#if FF_API_AVFRAME_LAVC
|
||||||
|
AV_NOWARN_DEPRECATED(
|
||||||
dst->type = src->type;
|
dst->type = src->type;
|
||||||
|
);
|
||||||
#endif
|
#endif
|
||||||
dst->pkt_pts = src->pkt_pts;
|
dst->pkt_pts = src->pkt_pts;
|
||||||
dst->pkt_dts = src->pkt_dts;
|
dst->pkt_dts = src->pkt_dts;
|
||||||
|
@ -496,15 +502,19 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
|
||||||
av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0);
|
av_dict_copy(&sd_dst->metadata, sd_src->metadata, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AV_NOWARN_DEPRECATED(
|
||||||
dst->qscale_table = NULL;
|
dst->qscale_table = NULL;
|
||||||
dst->qstride = 0;
|
dst->qstride = 0;
|
||||||
dst->qscale_type = 0;
|
dst->qscale_type = 0;
|
||||||
|
);
|
||||||
if (src->qp_table_buf) {
|
if (src->qp_table_buf) {
|
||||||
dst->qp_table_buf = av_buffer_ref(src->qp_table_buf);
|
dst->qp_table_buf = av_buffer_ref(src->qp_table_buf);
|
||||||
if (dst->qp_table_buf) {
|
if (dst->qp_table_buf) {
|
||||||
dst->qscale_table = dst->qp_table_buf->data;
|
AV_NOWARN_DEPRECATED(
|
||||||
|
dst->qscale_table = (int8_t *) dst->qp_table_buf->data;
|
||||||
dst->qstride = src->qstride;
|
dst->qstride = src->qstride;
|
||||||
dst->qscale_type = src->qscale_type;
|
dst->qscale_type = src->qscale_type;
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,7 @@
|
||||||
* without modification. Used to disable the definition of strings
|
* without modification. Used to disable the definition of strings
|
||||||
* (for example AVCodec long_names).
|
* (for example AVCodec long_names).
|
||||||
*/
|
*/
|
||||||
|
#undef NULL_IF_CONFIG_SMALL
|
||||||
#if CONFIG_SMALL
|
#if CONFIG_SMALL
|
||||||
# define NULL_IF_CONFIG_SMALL(x) NULL
|
# define NULL_IF_CONFIG_SMALL(x) NULL
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -242,11 +242,11 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
strcpy(prev, line);
|
strcpy(prev, line);
|
||||||
sanitize(part[0].str);
|
sanitize((uint8_t *) part[0].str);
|
||||||
colored_fputs(type[0], part[0].str);
|
colored_fputs(type[0], part[0].str);
|
||||||
sanitize(part[1].str);
|
sanitize((uint8_t *) part[1].str);
|
||||||
colored_fputs(type[1], part[1].str);
|
colored_fputs(type[1], part[1].str);
|
||||||
sanitize(part[2].str);
|
sanitize((uint8_t *) part[2].str);
|
||||||
colored_fputs(av_clip(level >> 3, 0, 6), part[2].str);
|
colored_fputs(av_clip(level >> 3, 0, 6), part[2].str);
|
||||||
av_bprint_finalize(part+2, NULL);
|
av_bprint_finalize(part+2, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,7 @@ static int read_number(const AVOption *o, void *dst, double *num, int *den, int6
|
||||||
*den = ((AVRational*)dst)->den;
|
*den = ((AVRational*)dst)->den;
|
||||||
return 0;
|
return 0;
|
||||||
case AV_OPT_TYPE_CONST: *num = o->default_val.dbl; return 0;
|
case AV_OPT_TYPE_CONST: *num = o->default_val.dbl; return 0;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
@ -169,7 +170,7 @@ static int set_string_binary(void *obj, const AVOption *o, const char *val, uint
|
||||||
static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **dst)
|
static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **dst)
|
||||||
{
|
{
|
||||||
av_freep(dst);
|
av_freep(dst);
|
||||||
*dst = av_strdup(val);
|
*dst = (uint8_t *)av_strdup(val);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,6 +342,8 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
|
||||||
av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as color\n", val);
|
av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as color\n", val);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
|
|
||||||
av_log(obj, AV_LOG_ERROR, "Invalid option type.\n");
|
av_log(obj, AV_LOG_ERROR, "Invalid option type.\n");
|
||||||
|
@ -588,19 +591,19 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
switch (o->type) {
|
switch (o->type) {
|
||||||
case AV_OPT_TYPE_FLAGS: ret = snprintf(buf, sizeof(buf), "0x%08X", *(int *)dst);break;
|
case AV_OPT_TYPE_FLAGS: ret = snprintf((char *)buf, sizeof(buf), "0x%08X", *(int *)dst);break;
|
||||||
case AV_OPT_TYPE_INT: ret = snprintf(buf, sizeof(buf), "%d" , *(int *)dst);break;
|
case AV_OPT_TYPE_INT: ret = snprintf((char *)buf, sizeof(buf), "%d" , *(int *)dst);break;
|
||||||
case AV_OPT_TYPE_INT64: ret = snprintf(buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break;
|
case AV_OPT_TYPE_INT64: ret = snprintf((char *)buf, sizeof(buf), "%"PRId64, *(int64_t*)dst);break;
|
||||||
case AV_OPT_TYPE_FLOAT: ret = snprintf(buf, sizeof(buf), "%f" , *(float *)dst);break;
|
case AV_OPT_TYPE_FLOAT: ret = snprintf((char *)buf, sizeof(buf), "%f" , *(float *)dst);break;
|
||||||
case AV_OPT_TYPE_DOUBLE: ret = snprintf(buf, sizeof(buf), "%f" , *(double *)dst);break;
|
case AV_OPT_TYPE_DOUBLE: ret = snprintf((char *)buf, sizeof(buf), "%f" , *(double *)dst);break;
|
||||||
case AV_OPT_TYPE_VIDEO_RATE:
|
case AV_OPT_TYPE_VIDEO_RATE:
|
||||||
case AV_OPT_TYPE_RATIONAL: ret = snprintf(buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
|
case AV_OPT_TYPE_RATIONAL: ret = snprintf((char *)buf, sizeof(buf), "%d/%d", ((AVRational*)dst)->num, ((AVRational*)dst)->den);break;
|
||||||
case AV_OPT_TYPE_CONST: ret = snprintf(buf, sizeof(buf), "%f" , o->default_val.dbl);break;
|
case AV_OPT_TYPE_CONST: ret = snprintf((char *)buf, sizeof(buf), "%f" , o->default_val.dbl);break;
|
||||||
case AV_OPT_TYPE_STRING:
|
case AV_OPT_TYPE_STRING:
|
||||||
if (*(uint8_t**)dst)
|
if (*(uint8_t**)dst)
|
||||||
*out_val = av_strdup(*(uint8_t**)dst);
|
*out_val = (uint8_t*)av_strdup(*(char**)dst);
|
||||||
else
|
else
|
||||||
*out_val = av_strdup("");
|
*out_val = (uint8_t*)av_strdup("");
|
||||||
return 0;
|
return 0;
|
||||||
case AV_OPT_TYPE_BINARY:
|
case AV_OPT_TYPE_BINARY:
|
||||||
len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));
|
len = *(int*)(((uint8_t *)dst) + sizeof(uint8_t *));
|
||||||
|
@ -610,25 +613,25 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
bin = *(uint8_t**)dst;
|
bin = *(uint8_t**)dst;
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
snprintf(*out_val + i*2, 3, "%02X", bin[i]);
|
snprintf((char *)*out_val + i*2, 3, "%02X", bin[i]);
|
||||||
return 0;
|
return 0;
|
||||||
case AV_OPT_TYPE_IMAGE_SIZE:
|
case AV_OPT_TYPE_IMAGE_SIZE:
|
||||||
ret = snprintf(buf, sizeof(buf), "%dx%d", ((int *)dst)[0], ((int *)dst)[1]);
|
ret = snprintf((char *)buf, sizeof(buf), "%dx%d", ((int *)dst)[0], ((int *)dst)[1]);
|
||||||
break;
|
break;
|
||||||
case AV_OPT_TYPE_PIXEL_FMT:
|
case AV_OPT_TYPE_PIXEL_FMT:
|
||||||
ret = snprintf(buf, sizeof(buf), "%s", (char *)av_x_if_null(av_get_pix_fmt_name(*(enum AVPixelFormat *)dst), "none"));
|
ret = snprintf((char *)buf, sizeof(buf), "%s", (char *)av_x_if_null(av_get_pix_fmt_name(*(enum AVPixelFormat *)dst), "none"));
|
||||||
break;
|
break;
|
||||||
case AV_OPT_TYPE_SAMPLE_FMT:
|
case AV_OPT_TYPE_SAMPLE_FMT:
|
||||||
ret = snprintf(buf, sizeof(buf), "%s", (char *)av_x_if_null(av_get_sample_fmt_name(*(enum AVSampleFormat *)dst), "none"));
|
ret = snprintf((char *)buf, sizeof(buf), "%s", (char *)av_x_if_null(av_get_sample_fmt_name(*(enum AVSampleFormat *)dst), "none"));
|
||||||
break;
|
break;
|
||||||
case AV_OPT_TYPE_DURATION:
|
case AV_OPT_TYPE_DURATION:
|
||||||
i64 = *(int64_t *)dst;
|
i64 = *(int64_t *)dst;
|
||||||
ret = snprintf(buf, sizeof(buf), "%"PRIi64"d:%02d:%02d.%06d",
|
ret = snprintf((char *)buf, sizeof(buf), "%"PRIi64"d:%02d:%02d.%06d",
|
||||||
i64 / 3600000000, (int)((i64 / 60000000) % 60),
|
i64 / 3600000000, (int)((i64 / 60000000) % 60),
|
||||||
(int)((i64 / 1000000) % 60), (int)(i64 % 1000000));
|
(int)((i64 / 1000000) % 60), (int)(i64 % 1000000));
|
||||||
break;
|
break;
|
||||||
case AV_OPT_TYPE_COLOR:
|
case AV_OPT_TYPE_COLOR:
|
||||||
ret = snprintf(buf, sizeof(buf), "0x%02x%02x%02x%02x", ((int *)dst)[0], ((int *)dst)[1], ((int *)dst)[2], ((int *)dst)[3]);
|
ret = snprintf((char *)buf, sizeof(buf), "0x%02x%02x%02x%02x", ((int *)dst)[0], ((int *)dst)[1], ((int *)dst)[2], ((int *)dst)[3]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
@ -636,7 +639,7 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
|
||||||
|
|
||||||
if (ret >= sizeof(buf))
|
if (ret >= sizeof(buf))
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
*out_val = av_strdup(buf);
|
*out_val = (uint8_t*) av_strdup((char *)buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,6 +935,7 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
|
||||||
av_log(av_log_obj, AV_LOG_INFO, ")");
|
av_log(av_log_obj, AV_LOG_INFO, ")");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
av_opt_freep_ranges(&r);
|
av_opt_freep_ranges(&r);
|
||||||
}
|
}
|
||||||
|
@ -972,6 +976,8 @@ static void opt_list(void *obj, void *av_log_obj, const char *unit,
|
||||||
case AV_OPT_TYPE_STRING:
|
case AV_OPT_TYPE_STRING:
|
||||||
case AV_OPT_TYPE_VIDEO_RATE:
|
case AV_OPT_TYPE_VIDEO_RATE:
|
||||||
av_log(av_log_obj, AV_LOG_INFO, "\"%s\"", opt->default_val.str);
|
av_log(av_log_obj, AV_LOG_INFO, "\"%s\"", opt->default_val.str);
|
||||||
|
break;
|
||||||
|
default:break;
|
||||||
}
|
}
|
||||||
av_log(av_log_obj, AV_LOG_INFO, ")");
|
av_log(av_log_obj, AV_LOG_INFO, ")");
|
||||||
}
|
}
|
||||||
|
@ -998,7 +1004,9 @@ int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
|
||||||
void av_opt_set_defaults(void *s)
|
void av_opt_set_defaults(void *s)
|
||||||
{
|
{
|
||||||
#if FF_API_OLD_AVOPTIONS
|
#if FF_API_OLD_AVOPTIONS
|
||||||
|
AV_NOWARN_DEPRECATED(
|
||||||
av_opt_set_defaults2(s, 0, 0);
|
av_opt_set_defaults2(s, 0, 0);
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void av_opt_set_defaults2(void *s, int mask, int flags)
|
void av_opt_set_defaults2(void *s, int mask, int flags)
|
||||||
|
@ -1300,18 +1308,18 @@ const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
|
||||||
if (search_flags & AV_OPT_SEARCH_CHILDREN) {
|
if (search_flags & AV_OPT_SEARCH_CHILDREN) {
|
||||||
if (search_flags & AV_OPT_SEARCH_FAKE_OBJ) {
|
if (search_flags & AV_OPT_SEARCH_FAKE_OBJ) {
|
||||||
const AVClass *child = NULL;
|
const AVClass *child = NULL;
|
||||||
while (child = av_opt_child_class_next(c, child))
|
while ((child = av_opt_child_class_next(c, child)))
|
||||||
if (o = av_opt_find2(&child, name, unit, opt_flags, search_flags, NULL))
|
if ((o = av_opt_find2(&child, name, unit, opt_flags, search_flags, NULL)))
|
||||||
return o;
|
return o;
|
||||||
} else {
|
} else {
|
||||||
void *child = NULL;
|
void *child = NULL;
|
||||||
while (child = av_opt_child_next(obj, child))
|
while ((child = av_opt_child_next(obj, child)))
|
||||||
if (o = av_opt_find2(child, name, unit, opt_flags, search_flags, target_obj))
|
if ((o = av_opt_find2(child, name, unit, opt_flags, search_flags, target_obj)))
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (o = av_opt_next(obj, o)) {
|
while ((o = av_opt_next(obj, o))) {
|
||||||
if (!strcmp(o->name, name) && (o->flags & opt_flags) == opt_flags &&
|
if (!strcmp(o->name, name) && (o->flags & opt_flags) == opt_flags &&
|
||||||
((!unit && o->type != AV_OPT_TYPE_CONST) ||
|
((!unit && o->type != AV_OPT_TYPE_CONST) ||
|
||||||
(unit && o->type == AV_OPT_TYPE_CONST && o->unit && !strcmp(o->unit, unit)))) {
|
(unit && o->type == AV_OPT_TYPE_CONST && o->unit && !strcmp(o->unit, unit)))) {
|
||||||
|
|
|
@ -1992,10 +1992,13 @@ int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_check_pixfmt_descriptors(void){
|
void ff_check_pixfmt_descriptors(void){
|
||||||
int i, j;
|
int i, j, k;
|
||||||
|
|
||||||
for (i=0; i<FF_ARRAY_ELEMS(av_pix_fmt_descriptors); i++) {
|
AV_NOWARN_DEPRECATED( k = FF_ARRAY_ELEMS(av_pix_fmt_descriptors); );
|
||||||
|
for (i=0; i<k; i++) {
|
||||||
|
AV_NOWARN_DEPRECATED(
|
||||||
const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
|
const AVPixFmtDescriptor *d = &av_pix_fmt_descriptors[i];
|
||||||
|
);
|
||||||
uint8_t fill[4][8+6+3] = {{0}};
|
uint8_t fill[4][8+6+3] = {{0}};
|
||||||
uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
|
uint8_t *data[4] = {fill[0], fill[1], fill[2], fill[3]};
|
||||||
int linesize[4] = {0,0,0,0};
|
int linesize[4] = {0,0,0,0};
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue