- 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;
- }
- printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n", video_stream,
- av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), fr->pkt_duration,
- number_of_written_bytes, av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes));
+
+ 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");
+ av_frame_unref(fr);
+ return number_of_written_bytes;