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

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


Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
---
 libavdevice/alsa_enc.c |  2 +-
 libavdevice/lavfi.c    | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c
index bddc61f..0bef625 100644
--- a/libavdevice/alsa_enc.c
+++ b/libavdevice/alsa_enc.c
@@ -130,7 +130,7 @@ static int audio_write_frame(AVFormatContext *s1, int stream_index,
     pkt.data     = (*frame)->data[0];
     pkt.size     = (*frame)->nb_samples * s->frame_size;
     pkt.dts      = (*frame)->pkt_dts;
-    pkt.duration = av_frame_get_pkt_duration(*frame);
+    pkt.duration = (*frame)->pkt_duration;
     return audio_write_packet(s1, &pkt);
 }
 
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index eca3f15..ede391f 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -376,7 +376,7 @@ static int create_subcc_packet(AVFormatContext *avctx, AVFrame *frame,
     memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
     lavfi->subcc_packet.stream_index = stream_idx;
     lavfi->subcc_packet.pts = frame->pts;
-    lavfi->subcc_packet.pos = av_frame_get_pkt_pos(frame);
+    lavfi->subcc_packet.pos = frame->pkt_pos;
     return 0;
 }
 
@@ -440,15 +440,15 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
 
         av_image_copy_to_buffer(pkt->data, size, (const uint8_t **)frame->data, frame->linesize,
                                 frame->format, frame->width, frame->height, 1);
-    } else if (av_frame_get_channels(frame) /* FIXME test audio */) {
+    } else if (frame->channels /* FIXME test audio */) {
         size = frame->nb_samples * av_get_bytes_per_sample(frame->format) *
-                                   av_frame_get_channels(frame);
+                                   frame->channels;
         if ((ret = av_new_packet(pkt, size)) < 0)
             return ret;
         memcpy(pkt->data, frame->data[0], size);
     }
 
-    frame_metadata = av_frame_get_metadata(frame);
+    frame_metadata = frame->metadata;
     if (frame_metadata) {
         uint8_t *metadata;
         AVDictionaryEntry *e = NULL;
@@ -479,7 +479,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
 
     pkt->stream_index = stream_idx;
     pkt->pts = frame->pts;
-    pkt->pos = av_frame_get_pkt_pos(frame);
+    pkt->pos = frame->pkt_pos;
     pkt->size = size;
     av_frame_unref(frame);
     return size;
-- 
2.9.3



More information about the ffmpeg-devel mailing list