You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	stack overflow
Originally committed as revision 3389 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
							
								
								
									
										6
									
								
								ffmpeg.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								ffmpeg.c
									
									
									
									
									
								
							| @@ -1078,7 +1078,6 @@ static int output_packet(AVInputStream *ist, int ist_index, | |||||||
|     uint8_t *data_buf; |     uint8_t *data_buf; | ||||||
|     int data_size, got_picture; |     int data_size, got_picture; | ||||||
|     AVFrame picture; |     AVFrame picture; | ||||||
|     short samples[pkt && pkt->size > AVCODEC_MAX_AUDIO_FRAME_SIZE/2 ? pkt->size : AVCODEC_MAX_AUDIO_FRAME_SIZE/2]; |  | ||||||
|     void *buffer_to_free; |     void *buffer_to_free; | ||||||
|  |  | ||||||
|     if (pkt && pkt->dts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too |     if (pkt && pkt->dts != AV_NOPTS_VALUE) { //FIXME seems redundant, as libavformat does this too | ||||||
| @@ -1103,9 +1102,10 @@ static int output_packet(AVInputStream *ist, int ist_index, | |||||||
|         data_size = 0; |         data_size = 0; | ||||||
|         if (ist->decoding_needed) { |         if (ist->decoding_needed) { | ||||||
|             switch(ist->st->codec.codec_type) { |             switch(ist->st->codec.codec_type) { | ||||||
|             case CODEC_TYPE_AUDIO: |             case CODEC_TYPE_AUDIO:{ | ||||||
|                     /* XXX: could avoid copy if PCM 16 bits with same |                     /* XXX: could avoid copy if PCM 16 bits with same | ||||||
|                        endianness as CPU */ |                        endianness as CPU */ | ||||||
|  |                 short samples[pkt && pkt->size > AVCODEC_MAX_AUDIO_FRAME_SIZE/2 ? pkt->size : AVCODEC_MAX_AUDIO_FRAME_SIZE/2]; | ||||||
|                 ret = avcodec_decode_audio(&ist->st->codec, samples, &data_size, |                 ret = avcodec_decode_audio(&ist->st->codec, samples, &data_size, | ||||||
|                                            ptr, len); |                                            ptr, len); | ||||||
|                 if (ret < 0) |                 if (ret < 0) | ||||||
| @@ -1121,7 +1121,7 @@ static int output_packet(AVInputStream *ist, int ist_index, | |||||||
|                 data_buf = (uint8_t *)samples; |                 data_buf = (uint8_t *)samples; | ||||||
|                 ist->next_pts += ((int64_t)AV_TIME_BASE/2 * data_size) /  |                 ist->next_pts += ((int64_t)AV_TIME_BASE/2 * data_size) /  | ||||||
|                     (ist->st->codec.sample_rate * ist->st->codec.channels); |                     (ist->st->codec.sample_rate * ist->st->codec.channels); | ||||||
|                 break; |                 break;} | ||||||
|             case CODEC_TYPE_VIDEO: |             case CODEC_TYPE_VIDEO: | ||||||
|                     data_size = (ist->st->codec.width * ist->st->codec.height * 3) / 2; |                     data_size = (ist->st->codec.width * ist->st->codec.height * 3) / 2; | ||||||
|                     /* XXX: allocate picture correctly */ |                     /* XXX: allocate picture correctly */ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user