[FFmpeg-cvslog] wtvenc: output third video pts in timestamp chunk ( this is what Microsoft Windows Media Center expects)
Peter Ross
git at videolan.org
Wed Nov 7 13:51:52 CET 2012
ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Wed Nov 7 16:52:12 2012 +1100| [3e65134326b8b904ae95e1fd848c85bbcc12dac6] | committer: Michael Niedermayer
wtvenc: output third video pts in timestamp chunk (this is what Microsoft Windows Media Center expects)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e65134326b8b904ae95e1fd848c85bbcc12dac6
---
libavformat/wtvenc.c | 7 +------
tests/ref/lavf/wtv | 2 +-
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/libavformat/wtvenc.c b/libavformat/wtvenc.c
index e86bfeb..e078213 100644
--- a/libavformat/wtvenc.c
+++ b/libavformat/wtvenc.c
@@ -84,7 +84,6 @@ typedef struct {
WtvFile file[WTV_FILES];
int64_t serial; /** chunk serial number */
int64_t last_chunk_pos; /** last chunk position */
- int64_t frame_nb;
WtvChunkEntry index[MAX_NB_INDEX];
int nb_index;
@@ -374,19 +373,15 @@ static void write_timestamp(AVFormatContext *s, AVPacket *pkt)
WtvContext *wctx = s->priv_data;
AVCodecContext *enc = s->streams[pkt->stream_index]->codec;
int flag = 0;
- int64_t frame_number = 0;
if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
- wctx->frame_nb++;
- frame_number = wctx->frame_nb;
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, frame_number);
+ avio_wl64(pb, pkt->pts == AV_NOPTS_VALUE ? -1 : pkt->pts);
avio_wl64(pb, 0);
avio_wl64(pb, flag);
avio_wl64(pb, 0);
diff --git a/tests/ref/lavf/wtv b/tests/ref/lavf/wtv
index 6481160..0aaa01a 100644
--- a/tests/ref/lavf/wtv
+++ b/tests/ref/lavf/wtv
@@ -1,3 +1,3 @@
-accf6a5131e2eba81c9aa9fa8f0eb69a *./tests/data/lavf/lavf.wtv
+dcb02f245dca4597704cbfc06e7eb543 *./tests/data/lavf/lavf.wtv
413696 ./tests/data/lavf/lavf.wtv
./tests/data/lavf/lavf.wtv CRC=0xcc2dc628
More information about the ffmpeg-cvslog
mailing list