[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35546 - Extractor/src/plugins
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35546 - Extractor/src/plugins |
Date: |
Tue, 21 Apr 2015 17:52:15 +0200 |
Author: LRN
Date: 2015-04-21 17:52:14 +0200 (Tue, 21 Apr 2015)
New Revision: 35546
Modified:
Extractor/src/plugins/previewopus_extractor.c
Log:
Minor style fix for previewopus
Modified: Extractor/src/plugins/previewopus_extractor.c
===================================================================
--- Extractor/src/plugins/previewopus_extractor.c 2015-04-21 15:52:12 UTC
(rev 35545)
+++ Extractor/src/plugins/previewopus_extractor.c 2015-04-21 15:52:14 UTC
(rev 35546)
@@ -230,7 +230,7 @@
/** Guess the desired container format based on the file extension. */
if (!((*output_format_context)->oformat = av_guess_format(NULL, "file.ogg",
NULL))) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not find output file format\n");
#endif
goto cleanup;
@@ -239,7 +239,7 @@
/** Find the encoder to be used by its name. */
if (!(output_codec = avcodec_find_encoder(AV_CODEC_ID_OPUS))) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not find an OPUS encoder.\n");
#endif
goto cleanup;
@@ -247,7 +247,7 @@
/** Create a new audio stream in the output file container. */
if (!(stream = avformat_new_stream(*output_format_context, output_codec)))
{
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not create new stream\n");
#endif
error = AVERROR(ENOMEM);
@@ -271,7 +271,7 @@
/** Open the encoder for the audio stream to use it later. */
if ((error = avcodec_open2(*output_codec_context, output_codec, NULL)) <
0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not open output codec (error '%s')\n",
get_error_text(error));
#endif
@@ -297,7 +297,7 @@
static int init_input_frame(AVFrame **frame)
{
if (!(*frame = avcodec_alloc_frame())) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not allocate input frame\n");
#endif
return AVERROR(ENOMEM);
@@ -324,9 +324,9 @@
/** Create a resampler context for the conversion. */
if (!(*resample_context = avresample_alloc_context())) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not allocate resample context\n");
- #endif
+#endif
return AVERROR(ENOMEM);
}
@@ -352,9 +352,9 @@
/** Open the resampler with the specified parameters. */
if ((error = avresample_open(*resample_context)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not open resample context\n");
- #endif
+#endif
avresample_free(resample_context);
return error;
}
@@ -367,9 +367,9 @@
{
/** Create the FIFO buffer based on the specified output sample format. */
if (!(*fifo = av_audio_fifo_alloc(OUTPUT_SAMPLE_FORMAT, OUTPUT_CHANNELS,
1))) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not allocate FIFO\n");
- #endif
+#endif
return AVERROR(ENOMEM);
}
return 0;
@@ -380,10 +380,10 @@
{
int error;
if ((error = avformat_write_header(output_format_context, NULL)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not write output file header (error '%s')\n",
get_error_text(error));
- #endif
+#endif
return error;
}
return 0;
@@ -405,16 +405,16 @@
if ((error = av_read_frame(input_format_context,
&input_packet)) < 0) {
/** If we are the the end of the file, flush the
decoder below. */
if (error == AVERROR_EOF){
- #if DEBUG
+#if DEBUG
fprintf(stderr, "EOF in decode_audio\n");
- #endif
+#endif
*finished = 1;
}
else {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not read frame (error
'%s')\n",
get_error_text(error));
- #endif
+#endif
return error;
}
}
@@ -431,10 +431,10 @@
*/
if ((error = avcodec_decode_audio4(input_codec_context, frame,
data_present, &input_packet)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not decode frame (error '%s')\n",
get_error_text(error));
- #endif
+#endif
av_free_packet(&input_packet);
return error;
}
@@ -467,9 +467,9 @@
*/
if (!(*converted_input_samples = calloc(output_codec_context->channels,
sizeof(**converted_input_samples)))) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not allocate converted input sample
pointers\n");
- #endif
+#endif
return AVERROR(ENOMEM);
}
@@ -481,11 +481,11 @@
output_codec_context->channels,
frame_size,
output_codec_context->sample_fmt, 0)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr,
"Could not allocate converted input samples (error '%s')\n",
get_error_text(error));
- #endif
+#endif
av_freep(&(*converted_input_samples)[0]);
free(*converted_input_samples);
return error;
@@ -507,10 +507,10 @@
/** Convert the samples using the resampler. */
if ((error = avresample_convert(resample_context, converted_data,
out_linesize,
out_sample, input_data, 0, in_sample)) < 0)
{
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not convert input samples (error '%s')\n",
get_error_text(error));
- #endif
+#endif
return error;
}
@@ -521,9 +521,9 @@
* If the sample rates differ, this case has to be handled differently
*/
if (avresample_available(resample_context)) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "%i Converted samples left
over\n",avresample_available(resample_context));
- #endif
+#endif
}
@@ -542,18 +542,18 @@
* the old and the new samples.
*/
if ((error = av_audio_fifo_realloc(fifo, av_audio_fifo_size(fifo) +
frame_size)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not reallocate FIFO\n");
- #endif
+#endif
return error;
}
/** Store the new samples in the FIFO buffer. */
if (av_audio_fifo_write(fifo, (void **)converted_input_samples,
frame_size) < frame_size) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not write data to FIFO\n");
- #endif
+#endif
return AVERROR_EXIT;
}
return 0;
@@ -579,18 +579,18 @@
/** Initialize temporary storage for one input frame. */
if (init_input_frame(&input_frame)){
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Failed at init frame\n");
- #endif
+#endif
goto cleanup;
}
/** Decode one frame worth of audio samples. */
if (decode_audio_frame(input_frame, input_format_context,
input_codec_context, audio_stream_index,
&data_present, finished)){
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Failed at decode audio\n");
- #endif
+#endif
goto cleanup;
@@ -602,9 +602,9 @@
*/
if (*finished && !data_present) {
ret = 0;
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Failed at finished or no data\n");
- #endif
+#endif
goto cleanup;
}
/** If there is decoded data, convert and store it */
@@ -619,9 +619,9 @@
/** Initialize the temporary storage for the converted input samples.
*/
if (init_converted_samples(&converted_input_samples, &out_linesize,
output_codec_context,
out_samples)){
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Failed at init_converted_samples\n");
- #endif
+#endif
goto cleanup;
}
@@ -633,17 +633,17 @@
input_frame->nb_samples, out_samples, out_linesize
,resampler_context)){
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Failed at convert_samples, input frame %i
\n",input_frame->nb_samples);
- #endif
+#endif
goto cleanup;
}
/** Add the converted input samples to the FIFO buffer for later
processing. */
if (add_samples_to_fifo(fifo, converted_input_samples,
out_samples)){
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Failed at add_samples_to_fifo\n");
- #endif
+#endif
goto cleanup;
}
ret = 0;
@@ -672,9 +672,9 @@
/** Create a new frame to store the audio samples. */
if (!(*frame = avcodec_alloc_frame())) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not allocate output frame\n");
- #endif
+#endif
return AVERROR_EXIT;
}
@@ -699,9 +699,9 @@
* sure that the audio frame can hold as many samples as specified.
*/
if ((error = av_frame_get_buffer(*frame, 0)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could allocate output frame samples (error
'%s')\n", get_error_text(error));
- #endif
+#endif
avcodec_free_frame(frame);
return error;
}
@@ -726,10 +726,10 @@
*/
if ((error = avcodec_encode_audio2(output_codec_context, &output_packet,
frame, data_present)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not encode frame (error '%s')\n",
get_error_text(error));
- #endif
+#endif
av_free_packet(&output_packet);
return error;
}
@@ -737,10 +737,10 @@
/** Write one audio frame from the temporary packet to the output file. */
if (*data_present) {
if ((error = av_write_frame(output_format_context, &output_packet)) <
0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not write frame (error '%s')\n",
get_error_text(error));
- #endif
+#endif
av_free_packet(&output_packet);
return error;
@@ -780,9 +780,9 @@
* The samples are stored in the frame temporarily.
*/
if (av_audio_fifo_read(fifo, (void **)output_frame->data, frame_size) <
frame_size) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not read data from FIFO\n");
- #endif
+#endif
avcodec_free_frame(&output_frame);
return AVERROR_EXIT;
}
@@ -801,10 +801,10 @@
{
int error;
if ((error = av_write_trailer(output_format_context)) < 0) {
- #if DEBUG
+#if DEBUG
fprintf(stderr, "Could not write output file trailer (error
'%s')\n",
get_error_text(error));
- #endif
+#endif
return error;
}
return 0;
@@ -865,7 +865,7 @@
av_dict_free (&options);
if (0 > avformat_find_stream_info (format_ctx, NULL))
{
- #if DEBUG
+#if DEBUG
fprintf (stderr,
"Failed to read stream info\n");
#endif
@@ -950,7 +950,7 @@
}
else
{
- #if DEBUG
+#if DEBUG
duration = format_ctx->duration;
fprintf (stderr,
"Duration: %lld\n",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35546 - Extractor/src/plugins,
gnunet <=