mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-08 02:06:02 +08:00
examples: do not use AVFrame accessor
Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
This commit is contained in:
@@ -201,7 +201,7 @@ end:
|
|||||||
|
|
||||||
static void print_frame(const AVFrame *frame)
|
static void print_frame(const AVFrame *frame)
|
||||||
{
|
{
|
||||||
const int n = frame->nb_samples * av_get_channel_layout_nb_channels(av_frame_get_channel_layout(frame));
|
const int n = frame->nb_samples * av_get_channel_layout_nb_channels(frame->channel_layout);
|
||||||
const uint16_t *p = (uint16_t*)frame->data[0];
|
const uint16_t *p = (uint16_t*)frame->data[0];
|
||||||
const uint16_t *p_end = p + n;
|
const uint16_t *p_end = p + n;
|
||||||
|
|
||||||
|
@@ -253,7 +253,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
frame->pts = av_frame_get_best_effort_timestamp(frame);
|
frame->pts = frame->best_effort_timestamp;
|
||||||
|
|
||||||
/* push the decoded frame into the filtergraph */
|
/* push the decoded frame into the filtergraph */
|
||||||
if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) {
|
if (av_buffersrc_add_frame_flags(buffersrc_ctx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) < 0) {
|
||||||
|
@@ -558,7 +558,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (got_frame) {
|
if (got_frame) {
|
||||||
frame->pts = av_frame_get_best_effort_timestamp(frame);
|
frame->pts = frame->best_effort_timestamp;
|
||||||
ret = filter_encode_write_frame(frame, stream_index);
|
ret = filter_encode_write_frame(frame, stream_index);
|
||||||
av_frame_free(&frame);
|
av_frame_free(&frame);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Reference in New Issue
Block a user