Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 498194
Collapse All | Expand All

(-)a/examples/fpcalc.c (-3 / +7 lines)
Lines 33-38 int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name Link Here
33
	SwrContext *convert_ctx = NULL;
33
	SwrContext *convert_ctx = NULL;
34
#elif defined(HAVE_AVRESAMPLE)
34
#elif defined(HAVE_AVRESAMPLE)
35
	AVAudioResampleContext *convert_ctx = NULL;
35
	AVAudioResampleContext *convert_ctx = NULL;
36
#else
37
	void *convert_ctx = NULL;
36
#endif
38
#endif
37
	int max_dst_nb_samples = 0, dst_linsize = 0;
39
	int max_dst_nb_samples = 0, dst_linsize = 0;
38
	uint8_t *dst_data[1] = { NULL };
40
	uint8_t *dst_data[1] = { NULL };
Lines 75-80 int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name Link Here
75
		goto done;
77
		goto done;
76
	}
78
	}
77
79
80
#if defined(HAVE_SWRESAMPLE) || defined(HAVE_AVRESAMPLE)
78
	if (codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
81
	if (codec_ctx->sample_fmt != AV_SAMPLE_FMT_S16) {
79
		int64_t channel_layout = codec_ctx->channel_layout;
82
		int64_t channel_layout = codec_ctx->channel_layout;
80
		if (!channel_layout) {
83
		if (!channel_layout) {
Lines 111-116 int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name Link Here
111
		}
114
		}
112
#endif
115
#endif
113
	}
116
	}
117
#endif
114
118
115
	if (stream->duration != AV_NOPTS_VALUE) {
119
	if (stream->duration != AV_NOPTS_VALUE) {
116
		*duration = stream->time_base.num * stream->duration / stream->time_base.den;
120
		*duration = stream->time_base.num * stream->duration / stream->time_base.den;
Lines 155-164 int decode_audio_file(ChromaprintContext *chromaprint_ctx, const char *file_name Link Here
155
						max_dst_nb_samples = frame->nb_samples;
159
						max_dst_nb_samples = frame->nb_samples;
156
					}
160
					}
157
#if defined(HAVE_SWRESAMPLE)
161
#if defined(HAVE_SWRESAMPLE)
158
					if (swr_convert(convert_ctx, dst_data, frame->nb_samples, (const uint8_t **)frame->data, frame->nb_samples) < 0) {
162
					if (swr_convert(convert_ctx, dst_data, frame->nb_samples, (const uint8_t **)frame->data, frame->nb_samples) < 0)
159
#elif defined(HAVE_AVRESAMPLE)
163
#elif defined(HAVE_AVRESAMPLE)
160
					if (avresample_convert(convert_ctx, dst_data, 0, frame->nb_samples, (uint8_t **)frame->data, 0, frame->nb_samples) < 0) {
164
					if (avresample_convert(convert_ctx, dst_data, 0, frame->nb_samples, (uint8_t **)frame->data, 0, frame->nb_samples) < 0)
161
#endif
165
#endif
166
					{
162
						fprintf(stderr, "ERROR: couldn't convert the audio\n");
167
						fprintf(stderr, "ERROR: couldn't convert the audio\n");
163
						goto done;
168
						goto done;
164
					}
169
					}
165
- 

Return to bug 498194