Lines Matching defs:pkt
34 static void log_packet(const AVFormatContext *fmt_ctx, const AVPacket *pkt, const char *tag)
36 AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base;
40 av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base),
41 av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base),
42 av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base),
43 pkt->stream_index);
50 AVPacket *pkt = NULL;
68 pkt = av_packet_alloc();
69 if (!pkt) {
149 ret = av_read_frame(ifmt_ctx, pkt);
153 in_stream = ifmt_ctx->streams[pkt->stream_index];
154 if (pkt->stream_index >= stream_mapping_size ||
155 stream_mapping[pkt->stream_index] < 0) {
156 av_packet_unref(pkt);
160 pkt->stream_index = stream_mapping[pkt->stream_index];
161 out_stream = ofmt_ctx->streams[pkt->stream_index];
162 log_packet(ifmt_ctx, pkt, "in");
165 av_packet_rescale_ts(pkt, in_stream->time_base, out_stream->time_base);
166 pkt->pos = -1;
167 log_packet(ofmt_ctx, pkt, "out");
169 ret = av_interleaved_write_frame(ofmt_ctx, pkt);
170 /* pkt is now blank (av_interleaved_write_frame() takes ownership of
171 * its contents and resets pkt), so that no unreferencing is necessary.
181 av_packet_free(&pkt);