[FFmpeg-cvslog] avdevice: do not use AVFrame accessor
Muhammad Faiz
git at videolan.org
Sun Apr 23 11:13:23 EEST 2017
ffmpeg | branch: master | Muhammad Faiz <mfcc64 at gmail.com> | Sat Apr 22 15:56:47 2017 +0700| [8103c595223613c08e44bcf56ae7098d3c31be8b] | committer: Muhammad Faiz
avdevice: do not use AVFrame accessor
Reviewed-by: wm4 <nfxjfg at googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8103c595223613c08e44bcf56ae7098d3c31be8b
---
libavdevice/alsa_enc.c | 2 +-
libavdevice/lavfi.c | 10 +++++-----
libavdevice/pulse_audio_enc.c | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/libavdevice/alsa_enc.c b/libavdevice/alsa_enc.c
index bddc61f4aa..0bef625ea4 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 eca3f15934..ede391f4d6 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;
diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
index 6fb634ee2b..0efcf0fe7e 100644
--- a/libavdevice/pulse_audio_enc.c
+++ b/libavdevice/pulse_audio_enc.c
@@ -681,9 +681,9 @@ static int pulse_write_frame(AVFormatContext *h, int stream_index,
AVERROR(EINVAL) : 0;
pkt.data = (*frame)->data[0];
- pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * av_frame_get_channels(*frame);
+ pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->channels;
pkt.dts = (*frame)->pkt_dts;
- pkt.duration = av_frame_get_pkt_duration(*frame);
+ pkt.duration = (*frame)->pkt_duration;
return pulse_write_packet(h, &pkt);
}
More information about the ffmpeg-cvslog
mailing list