- if (got_frame) {
- number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, byte_buffer_size,
- (const uint8_t* const *)fr->data, (const int*) fr->linesize,
- ctx->pix_fmt, ctx->width, ctx->height, 1);
- if (number_of_written_bytes < 0) {
- av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
- return number_of_written_bytes;
- }
- if (draw_horiz_band_called == 0) {
- av_log(NULL, AV_LOG_ERROR, "draw_horiz_band haven't been called!\n");
- return -1;
- }
- if (av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes) !=
- av_adler32_update(0, (const uint8_t*)slice_byte_buffer, number_of_written_bytes)) {
- av_log(NULL, AV_LOG_ERROR, "Decoded frames with and without draw_horiz_band are not the same!\n");
- return -1;
- }
+
+ number_of_written_bytes = av_image_copy_to_buffer(byte_buffer, byte_buffer_size,
+ (const uint8_t* const *)fr->data, (const int*) fr->linesize,
+ ctx->pix_fmt, ctx->width, ctx->height, 1);
+ if (number_of_written_bytes < 0) {
+ av_log(NULL, AV_LOG_ERROR, "Can't copy image to buffer\n");
+ return number_of_written_bytes;
+ }
+ if (draw_horiz_band_called == 0) {
+ av_log(NULL, AV_LOG_ERROR, "draw_horiz_band haven't been called!\n");
+ return -1;
+ }
+ if (av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes) !=
+ av_adler32_update(0, (const uint8_t*)slice_byte_buffer, number_of_written_bytes)) {
+ av_log(NULL, AV_LOG_ERROR, "Decoded frames with and without draw_horiz_band are not the same!\n");
+ return -1;