diff options
author | Vladimir Pantelic <vladoman@gmail.com> | 2013-09-19 17:50:37 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-09-19 19:37:59 +0200 |
commit | 09f3c937ed6fd7c5bd64450d45f73b0f4975f4c9 (patch) | |
tree | 8999de602db7a12ab5110841aa71ffb1ebc49c8c /libavformat | |
parent | 1eb932803037a3c9f98f66aeb80024dfa3c5c743 (diff) | |
download | ffmpeg-09f3c937ed6fd7c5bd64450d45f73b0f4975f4c9.tar.gz |
asfenc: remember send time and offset of the index entries
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/asf.h | 2 | ||||
-rw-r--r-- | libavformat/asfenc.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/asf.h b/libavformat/asf.h index 4ac644e217..2f6722adca 100644 --- a/libavformat/asf.h +++ b/libavformat/asf.h @@ -78,6 +78,8 @@ typedef struct ASFMainHeader { typedef struct ASFIndex { uint32_t packet_number; uint16_t packet_count; + uint64_t send_time; + uint64_t offset; } ASFIndex; extern const ff_asf_guid ff_asf_header; diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index e37b6f7d44..7e1594bc1d 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -762,12 +762,14 @@ static void put_frame(AVFormatContext *s, ASFStream *stream, AVStream *avst, static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) { ASFContext *asf = s->priv_data; + AVIOContext *pb = s->pb; ASFStream *stream; int64_t duration; AVCodecContext *codec; int64_t packet_st, pts; int start_sec, i; int flags = pkt->flags; + uint64_t offset = avio_tell(pb); codec = s->streams[pkt->stream_index]->codec; stream = &asf->streams[pkt->stream_index]; @@ -802,6 +804,8 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) // store asf->index_ptr[i].packet_number = (uint32_t)packet_st; asf->index_ptr[i].packet_count = (uint16_t)(asf->nb_packets - packet_st); + asf->index_ptr[i].send_time = start_sec * INT64_C(10000000); + asf->index_ptr[i].offset = offset; asf->maximum_packet = FFMAX(asf->maximum_packet, (uint16_t)(asf->nb_packets - packet_st)); } |