FFmpeg: Move some error buffers around
Since in one case, it probably wasn't combining them into one stack allocation, it probably blew up the stack allocation quite a bit. Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This commit is contained in:
parent
9c6915ecb2
commit
eb72b73e6c
2 changed files with 6 additions and 9 deletions
|
@ -26,6 +26,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSArray *)urlsForContainerURL:(NSURL *)url {
|
+ (NSArray *)urlsForContainerURL:(NSURL *)url {
|
||||||
|
char errDescr[4096];
|
||||||
|
|
||||||
if([url fragment]) {
|
if([url fragment]) {
|
||||||
// input url already has fragment defined - no need to expand further
|
// input url already has fragment defined - no need to expand further
|
||||||
return [NSMutableArray arrayWithObject:url];
|
return [NSMutableArray arrayWithObject:url];
|
||||||
|
@ -65,7 +67,6 @@
|
||||||
|
|
||||||
NSString *urlString = [url absoluteString];
|
NSString *urlString = [url absoluteString];
|
||||||
if((errcode = avformat_open_input(&formatCtx, [urlString UTF8String], NULL, NULL)) < 0) {
|
if((errcode = avformat_open_input(&formatCtx, [urlString UTF8String], NULL, NULL)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
||||||
return [NSArray array];
|
return [NSArray array];
|
||||||
|
@ -102,7 +103,6 @@
|
||||||
formatCtx->pb = ioCtx;
|
formatCtx->pb = ioCtx;
|
||||||
|
|
||||||
if((errcode = avformat_open_input(&formatCtx, "", NULL, NULL)) < 0) {
|
if((errcode = avformat_open_input(&formatCtx, "", NULL, NULL)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
||||||
avformat_close_input(&(formatCtx));
|
avformat_close_input(&(formatCtx));
|
||||||
|
@ -116,7 +116,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if((errcode = avformat_find_stream_info(formatCtx, NULL)) < 0) {
|
if((errcode = avformat_find_stream_info(formatCtx, NULL)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Can't find stream info, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Can't find stream info, errcode = %d, error = %s", errcode, errDescr);
|
||||||
avformat_close_input(&(formatCtx));
|
avformat_close_input(&(formatCtx));
|
||||||
|
|
|
@ -82,6 +82,8 @@ static uint8_t reverse_bits[0x100];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)open:(id<CogSource>)s {
|
- (BOOL)open:(id<CogSource>)s {
|
||||||
|
char errDescr[4096];
|
||||||
|
|
||||||
int errcode, i;
|
int errcode, i;
|
||||||
AVStream *stream;
|
AVStream *stream;
|
||||||
|
|
||||||
|
@ -119,7 +121,6 @@ static uint8_t reverse_bits[0x100];
|
||||||
|
|
||||||
NSString *urlString = [url absoluteString];
|
NSString *urlString = [url absoluteString];
|
||||||
if((errcode = avformat_open_input(&formatCtx, [urlString UTF8String], NULL, NULL)) < 0) {
|
if((errcode = avformat_open_input(&formatCtx, [urlString UTF8String], NULL, NULL)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -146,7 +147,6 @@ static uint8_t reverse_bits[0x100];
|
||||||
formatCtx->pb = ioCtx;
|
formatCtx->pb = ioCtx;
|
||||||
|
|
||||||
if((errcode = avformat_open_input(&formatCtx, "", NULL, NULL)) < 0) {
|
if((errcode = avformat_open_input(&formatCtx, "", NULL, NULL)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Error opening file, errcode = %d, error = %s", errcode, errDescr);
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -154,7 +154,6 @@ static uint8_t reverse_bits[0x100];
|
||||||
}
|
}
|
||||||
|
|
||||||
if((errcode = avformat_find_stream_info(formatCtx, NULL)) < 0) {
|
if((errcode = avformat_find_stream_info(formatCtx, NULL)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Can't find stream info, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Can't find stream info, errcode = %d, error = %s", errcode, errDescr);
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -195,7 +194,6 @@ static uint8_t reverse_bits[0x100];
|
||||||
}
|
}
|
||||||
|
|
||||||
if((errcode = avcodec_parameters_to_context(codecCtx, codecPar)) < 0) {
|
if((errcode = avcodec_parameters_to_context(codecCtx, codecPar)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Can't copy codec parameters to context, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Can't copy codec parameters to context, errcode = %d, error = %s", errcode, errDescr);
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -266,7 +264,6 @@ static uint8_t reverse_bits[0x100];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!rawDSD && (errcode = avcodec_open2(codecCtx, codec, &dict)) < 0) {
|
if(!rawDSD && (errcode = avcodec_open2(codecCtx, codec, &dict)) < 0) {
|
||||||
char errDescr[4096];
|
|
||||||
av_dict_free(&dict);
|
av_dict_free(&dict);
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"could not open codec, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"could not open codec, errcode = %d, error = %s", errcode, errDescr);
|
||||||
|
@ -704,6 +701,8 @@ static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *va
|
||||||
}
|
}
|
||||||
|
|
||||||
- (AudioChunk *)readAudio {
|
- (AudioChunk *)readAudio {
|
||||||
|
char errDescr[4096];
|
||||||
|
|
||||||
if(!seekedToStart) {
|
if(!seekedToStart) {
|
||||||
[self seek:0];
|
[self seek:0];
|
||||||
}
|
}
|
||||||
|
@ -801,7 +800,6 @@ static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *va
|
||||||
readNextPacket = YES;
|
readNextPacket = YES;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
char errDescr[4096];
|
|
||||||
av_strerror(errcode, errDescr, 4096);
|
av_strerror(errcode, errDescr, 4096);
|
||||||
ALog(@"Error receiving frame, errcode = %d, error = %s", errcode, errDescr);
|
ALog(@"Error receiving frame, errcode = %d, error = %s", errcode, errDescr);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue