Skip to content

Commit 56e9227

Browse files
committed
bmdplay: Drop the deprecated AVPicture API
1 parent 0fce50b commit 56e9227

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

bmdplay.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
extern "C" {
3636
#include <libavformat/avformat.h>
3737
#include <libavcodec/avcodec.h>
38+
#include <libavutil/imgutils.h>
3839
#include <libavutil/mathematics.h>
3940
#include "libswscale/swscale.h"
4041
}
@@ -684,7 +685,6 @@ void Player::StopRunning()
684685
void Player::ScheduleNextFrame(bool prerolling)
685686
{
686687
AVPacket pkt;
687-
AVPicture picture;
688688

689689
if (serial_fd > 0 && packet_queue_get(&dataqueue, &pkt, 0)) {
690690
if (pkt.data[0] != ' '){
@@ -710,11 +710,14 @@ void Player::ScheduleNextFrame(bool prerolling)
710710

711711
avcodec_decode_video2(video.codec, avframe, &got_picture, &pkt);
712712
if (got_picture) {
713-
avpicture_fill(&picture, (uint8_t *)frame, pix_fmt,
714-
m_frameWidth, m_frameHeight);
713+
uint8_t *data[4];
714+
int linesize[4];
715+
716+
av_image_fill_arrays(data, linesize, (uint8_t *)frame,
717+
pix_fmt, m_frameWidth, m_frameHeight, 1);
715718

716719
sws_scale(sws, avframe->data, avframe->linesize, 0, avframe->height,
717-
picture.data, picture.linesize);
720+
data, linesize);
718721

719722
if (m_deckLinkOutput->ScheduleVideoFrame(videoFrame,
720723
pkt.pts *

0 commit comments

Comments
 (0)