mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-14 11:21:29 +00:00
wtvenc: simplify write_timestamp
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3e65134326
commit
b89cd2a028
@ -372,18 +372,14 @@ static void write_timestamp(AVFormatContext *s, AVPacket *pkt)
|
|||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
WtvContext *wctx = s->priv_data;
|
WtvContext *wctx = s->priv_data;
|
||||||
AVCodecContext *enc = s->streams[pkt->stream_index]->codec;
|
AVCodecContext *enc = s->streams[pkt->stream_index]->codec;
|
||||||
int flag = 0;
|
|
||||||
|
|
||||||
if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
|
|
||||||
flag = pkt->flags & AV_PKT_FLAG_KEY ? 1 : 0;
|
|
||||||
}
|
|
||||||
write_chunk_header(s, &ff_timestamp_guid, 56, 0x40000000 | (INDEX_BASE + pkt->stream_index));
|
write_chunk_header(s, &ff_timestamp_guid, 56, 0x40000000 | (INDEX_BASE + pkt->stream_index));
|
||||||
write_pad(pb, 8);
|
write_pad(pb, 8);
|
||||||
avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
|
avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
|
||||||
avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
|
avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
|
||||||
avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
|
avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
|
||||||
avio_wl64(pb, 0);
|
avio_wl64(pb, 0);
|
||||||
avio_wl64(pb, flag);
|
avio_wl64(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & AV_PKT_FLAG_KEY) ? 1 : 0);
|
||||||
avio_wl64(pb, 0);
|
avio_wl64(pb, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user