summaryrefslogtreecommitdiff
path: root/libavformat/wtvenc.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2012-11-07 16:52:21 +1100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-07 13:51:38 +0100
commitb89cd2a0289fc667d21c8e0f693722ca068ed52b (patch)
treeecf70e1ceb53a05f6f82d9eb4b93cfc75f90f3d7 /libavformat/wtvenc.c
parent3e65134326b8b904ae95e1fd848c85bbcc12dac6 (diff)
wtvenc: simplify write_timestamp
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/wtvenc.c')
-rw-r--r--libavformat/wtvenc.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index e07821319f..9108bc0013 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -372,18 +372,14 @@ static void write_timestamp(AVFormatContext *s, AVPacket *pkt)
AVIOContext *pb = s->pb;
WtvContext *wctx = s->priv_data;
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_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, 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);
}