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
675675 klv.insert(klv.end(), packet.data.begin(), packet.data.end());
676676 }
677677
678− AVPacket klv_packet;
679− av_init_packet(&klv_packet);
678+ AVPacket klv_packet = { 0 };
680679 klv_packet.pts = pts;
681680 klv_packet.dts = pts;
682681 klv_packet.flags |= AV_PKT_FLAG_KEY;
@@ -874,8 +873,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 191 unmodified lines
874873
875874 // Handle Video Frame
876875 if (videoFrame) {
877− AVPacket pkt;
878− av_init_packet(&pkt);
876+ AVPacket pkt = { 0 };
879877 if (ctx->frameCount % 25 == 0) {
880878 unsigned long long qsize = avpacket_queue_size(&ctx->queue);
881879 av_log(avctx, AV_LOG_DEBUG,
@@ -977,7 +975,7 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 95 unmodified lines
977975
978976 if (!no_video) {
979977 IDeckLinkVideoFrameAncillary *vanc;
980− AVPacket txt_pkt;
978+ AVPacket txt_pkt = { 0 };
981979 uint8_t txt_buf0[3531]; // 35 * 46 bytes decoded teletext lines + 1 byte data_identifier + 1920 bytes OP47 decode buffer
982980 uint8_t *txt_buf = txt_buf0;
983981
@@ -1036,7 +1034,6 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 52 unmodified lines
10361034 txt_buf[1] = 0x2c; // data_unit_length
10371035 txt_buf += 46;
10381036 }
1039− av_init_packet(&txt_pkt);
10401037 txt_pkt.pts = pkt.pts;
10411038 txt_pkt.dts = pkt.dts;
10421039 txt_pkt.stream_index = ctx->teletext_st->index;
@@ -1060,9 +1057,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived( · 17 unmodified lines
10601057
10611058 // Handle Audio Frame
10621059 if (audioFrame) {
1063− AVPacket pkt;
1060+ AVPacket pkt = { 0 };
10641061 BMDTimeValue audio_pts;
1065− av_init_packet(&pkt);
10661062
10671063 //hack among hacks
10681064 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