[FFmpeg-devel] [PATCH 4/5] wtvenc: simplify write_timestamp
Peter Ross
pross at xvid.org
Wed Nov 7 06:52:21 CET 2012
---
libavformat/wtvenc.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index e078213..9108bc0 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);
}
--
1.7.10.4
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121107/0386b8b5/attachment.asc>
More information about the ffmpeg-devel
mailing list