Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>tags/n3.4
@@ -156,7 +156,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, | |||||
generate_raw_frame((uint16_t*)(in_frame->data[0]), i, enc_ctx->sample_rate, | generate_raw_frame((uint16_t*)(in_frame->data[0]), i, enc_ctx->sample_rate, | ||||
enc_ctx->channels, enc_ctx->frame_size); | enc_ctx->channels, enc_ctx->frame_size); | ||||
in_frame_bytes = in_frame->nb_samples * av_frame_get_channels(in_frame) * sizeof(uint16_t); | |||||
in_frame_bytes = in_frame->nb_samples * in_frame->channels * sizeof(uint16_t); | |||||
if (in_frame_bytes > in_frame->linesize[0]) { | if (in_frame_bytes > in_frame->linesize[0]) { | ||||
av_log(NULL, AV_LOG_ERROR, "Incorrect value of input frame linesize\n"); | av_log(NULL, AV_LOG_ERROR, "Incorrect value of input frame linesize\n"); | ||||
return 1; | return 1; | ||||
@@ -197,7 +197,7 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx, | |||||
av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different sample format\n"); | av_log(NULL, AV_LOG_ERROR, "Error frames before and after decoding has different sample format\n"); | ||||
return AVERROR_UNKNOWN; | return AVERROR_UNKNOWN; | ||||
} | } | ||||
out_frame_bytes = out_frame->nb_samples * av_frame_get_channels(out_frame) * sizeof(uint16_t); | |||||
out_frame_bytes = out_frame->nb_samples * out_frame->channels * sizeof(uint16_t); | |||||
if (out_frame_bytes > out_frame->linesize[0]) { | if (out_frame_bytes > out_frame->linesize[0]) { | ||||
av_log(NULL, AV_LOG_ERROR, "Incorrect value of output frame linesize\n"); | av_log(NULL, AV_LOG_ERROR, "Incorrect value of output frame linesize\n"); | ||||
return 1; | return 1; | ||||
@@ -132,7 +132,7 @@ static int video_decode_example(const char *input_filename) | |||||
return number_of_written_bytes; | return number_of_written_bytes; | ||||
} | } | ||||
printf("%d, %10"PRId64", %10"PRId64", %8"PRId64", %8d, 0x%08lx\n", video_stream, | printf("%d, %10"PRId64", %10"PRId64", %8"PRId64", %8d, 0x%08lx\n", video_stream, | ||||
fr->pts, fr->pkt_dts, av_frame_get_pkt_duration(fr), | |||||
fr->pts, 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_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes)); | ||||
} | } | ||||
av_packet_unref(&pkt); | av_packet_unref(&pkt); | ||||
@@ -145,7 +145,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream, | |||||
} | } | ||||
av_packet_unref(&pkt); | av_packet_unref(&pkt); | ||||
av_init_packet(&pkt); | av_init_packet(&pkt); | ||||
} while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + av_frame_get_pkt_duration(fr) <= ts_end))); | |||||
} while ((!end_of_stream || got_frame) && (no_seeking || (fr->pts + fr->pkt_duration <= ts_end))); | |||||
av_packet_unref(&pkt); | av_packet_unref(&pkt); | ||||
av_freep(&byte_buffer); | av_freep(&byte_buffer); | ||||
@@ -95,7 +95,7 @@ static void *sender_thread(void *arg) | |||||
av_frame_free(&msg.frame); | av_frame_free(&msg.frame); | ||||
break; | break; | ||||
} | } | ||||
av_frame_set_metadata(msg.frame, meta); | |||||
msg.frame->metadata = meta; | |||||
/* allocate a real frame in order to simulate "real" work */ | /* allocate a real frame in order to simulate "real" work */ | ||||
msg.frame->format = AV_PIX_FMT_RGBA; | msg.frame->format = AV_PIX_FMT_RGBA; | ||||
@@ -141,7 +141,7 @@ static void *receiver_thread(void *arg) | |||||
if (ret < 0) | if (ret < 0) | ||||
break; | break; | ||||
av_assert0(msg.magic == MAGIC); | av_assert0(msg.magic == MAGIC); | ||||
meta = av_frame_get_metadata(msg.frame); | |||||
meta = msg.frame->metadata; | |||||
e = av_dict_get(meta, "sig", NULL, 0); | e = av_dict_get(meta, "sig", NULL, 0); | ||||
av_log(NULL, AV_LOG_INFO, "got \"%s\" (%p)\n", e->value, msg.frame); | av_log(NULL, AV_LOG_INFO, "got \"%s\" (%p)\n", e->value, msg.frame); | ||||
av_frame_free(&msg.frame); | av_frame_free(&msg.frame); | ||||