History

avdevice/decklink_dec: stop using av_init_packet()

James Almer committed 5 years ago

Commit 6b3a5631 parent d365f741 file · +4 −8Browse files

Showing the changes to libavdevice/decklink_dec.cpp (1 of 1 file). Show all

Unified · Split

libavdevice/decklink_dec.cpp+4−8
@@ -675,8 +675,7 @@ static void handle_klv(AVFormatContext *avctx, decklink_ctx *ctx, IDeckLinkVideo · 674 unmodified lines
675 klv.insert(klv.end(), packet.data.begin(), packet.data.end());675 klv.insert(klv.end(), packet.data.begin(), packet.data.end());
676 }676 }
677 677
678 AVPacket klv_packet;678 AVPacket klv_packet = { 0 };
679 av_init_packet(&klv_packet);
680 klv_packet.pts = pts;679 klv_packet.pts = pts;
681 klv_packet.dts = pts;680 klv_packet.dts = pts;
682 klv_packet.flags |= AV_PKT_FLAG_KEY;681 klv_packet.flags |= AV_PKT_FLAG_KEY;
@@ -874,8 +873,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 191 unmodified lines
874 873
875 // Handle Video Frame874 // Handle Video Frame
876 if (videoFrame) {875 if (videoFrame) {
877 AVPacket pkt;876 AVPacket pkt = { 0 };
878 av_init_packet(&pkt);
879 if (ctx->frameCount % 25 == 0) {877 if (ctx->frameCount % 25 == 0) {
880 unsigned long long qsize = avpacket_queue_size(&ctx->queue);878 unsigned long long qsize = avpacket_queue_size(&ctx->queue);
881 av_log(avctx, AV_LOG_DEBUG,879 av_log(avctx, AV_LOG_DEBUG,
@@ -977,7 +975,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 95 unmodified lines
977 975
978 if (!no_video) {976 if (!no_video) {
979 IDeckLinkVideoFrameAncillary *vanc;977 IDeckLinkVideoFrameAncillary *vanc;
980 AVPacket txt_pkt;978 AVPacket txt_pkt = { 0 };
981 uint8_t txt_buf0[3531]; // 35 * 46 bytes decoded teletext lines + 1 byte data_identifier + 1920 bytes OP47 decode buffer979 uint8_t txt_buf0[3531]; // 35 * 46 bytes decoded teletext lines + 1 byte data_identifier + 1920 bytes OP47 decode buffer
982 uint8_t *txt_buf = txt_buf0;980 uint8_t *txt_buf = txt_buf0;
983 981
@@ -1036,7 +1034,6 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 52 unmodified lines
1036 txt_buf[1] = 0x2c; // data_unit_length1034 txt_buf[1] = 0x2c; // data_unit_length
1037 txt_buf += 46;1035 txt_buf += 46;
1038 }1036 }
1039 av_init_packet(&txt_pkt);
1040 txt_pkt.pts = pkt.pts;1037 txt_pkt.pts = pkt.pts;
1041 txt_pkt.dts = pkt.dts;1038 txt_pkt.dts = pkt.dts;
1042 txt_pkt.stream_index = ctx->teletext_st->index;1039 txt_pkt.stream_index = ctx->teletext_st->index;
@@ -1060,9 +1057,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 17 unmodified lines
1060 1057
1061 // Handle Audio Frame1058 // Handle Audio Frame
1062 if (audioFrame) {1059 if (audioFrame) {
1063 AVPacket pkt;1060 AVPacket pkt = { 0 };
1064 BMDTimeValue audio_pts;1061 BMDTimeValue audio_pts;
1065 av_init_packet(&pkt);
1066 1062
1067 //hack among hacks1063 //hack among hacks
1068 pkt.size = audioFrame->GetSampleFrameCount() * ctx->audio_st->codecpar->channels * (ctx->audio_depth / 8);1064 pkt.size = audioFrame->GetSampleFrameCount() * ctx->audio_st->codecpar->channels * (ctx->audio_depth / 8);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t