[FFmpeg-devel] [PATCH 7/7] tests: do not use AVFrame accessor

Muhammad Faiz mfcc64 at gmail.com
Sat Apr 22 12:04:28 EEST 2017


Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
---
 tests/api/api-flac-test.c          | 4 ++--
 tests/api/api-seek-test.c          | 2 +-
 tests/api/api-threadmessage-test.c | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/api/api-flac-test.c b/tests/api/api-flac-test.c
index 7b48059..c5a37f0 100644
--- a/tests/api/api-flac-test.c
+++ b/tests/api/api-flac-test.c
@@ -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,
                            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]) {
             av_log(NULL, AV_LOG_ERROR, "Incorrect value of input frame linesize\n");
             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");
                     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]) {
                     av_log(NULL, AV_LOG_ERROR, "Incorrect value of output frame linesize\n");
                     return 1;
diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index 4fd1e6e..2b32cb9 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -145,7 +145,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream,
         }
         av_packet_unref(&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_freep(&byte_buffer);
diff --git a/tests/api/api-threadmessage-test.c b/tests/api/api-threadmessage-test.c
index 3e0ac5c..05a8062 100644
--- a/tests/api/api-threadmessage-test.c
+++ b/tests/api/api-threadmessage-test.c
@@ -95,7 +95,7 @@ static void *sender_thread(void *arg)
                 av_frame_free(&msg.frame);
                 break;
             }
-            av_frame_set_metadata(msg.frame, meta);
+            msg.frame->metadata = meta;
 
             /* allocate a real frame in order to simulate "real" work */
             msg.frame->format = AV_PIX_FMT_RGBA;
@@ -141,7 +141,7 @@ static void *receiver_thread(void *arg)
             if (ret < 0)
                 break;
             av_assert0(msg.magic == MAGIC);
-            meta = av_frame_get_metadata(msg.frame);
+            meta = msg.frame->metadata;
             e = av_dict_get(meta, "sig", NULL, 0);
             av_log(NULL, AV_LOG_INFO, "got \"%s\" (%p)\n", e->value, msg.frame);
             av_frame_free(&msg.frame);
-- 
2.9.3



More information about the ffmpeg-devel mailing list