[FFmpeg-devel] [PATCH 6/9] wtvenc: output third video pts in timestamp chunk (this is what Microsoft Windows Media Center expects)

Peter Ross pross at xvid.org
Tue Nov 6 04:02:04 CET 2012


---
 libavformat/wtvenc.c |    7 +------
 1 file changed, 1 insertion(+), 6 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);
-- 
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/20121106/a3e22c45/attachment.asc>


More information about the ffmpeg-devel mailing list