Commit 6c55fd79 authored by Michael Niedermayer's avatar Michael Niedermayer

preroll is in ms

pts should start at start_time

Originally committed as revision 3771 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 53756443
...@@ -196,9 +196,9 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -196,9 +196,9 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (!asf_st) if (!asf_st)
goto fail; goto fail;
st->priv_data = asf_st; st->priv_data = asf_st;
st->start_time = asf->hdr.preroll / (10000000 / AV_TIME_BASE); st->start_time = asf->hdr.preroll * (int64_t)AV_TIME_BASE / 1000;
st->duration = (asf->hdr.send_time - asf->hdr.preroll) / st->duration = asf->hdr.send_time /
(10000000 / AV_TIME_BASE); (10000000 / AV_TIME_BASE) - st->start_time;
get_guid(pb, &g); get_guid(pb, &g);
if (!memcmp(&g, &audio_stream, sizeof(GUID))) { if (!memcmp(&g, &audio_stream, sizeof(GUID))) {
type = CODEC_TYPE_AUDIO; type = CODEC_TYPE_AUDIO;
...@@ -599,7 +599,7 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -599,7 +599,7 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
/* new packet */ /* new packet */
av_new_packet(&asf_st->pkt, asf->packet_obj_size); av_new_packet(&asf_st->pkt, asf->packet_obj_size);
asf_st->seq = asf->packet_seq; asf_st->seq = asf->packet_seq;
asf_st->pkt.pts = asf->packet_frag_timestamp - asf->hdr.preroll; asf_st->pkt.pts = asf->packet_frag_timestamp;
asf_st->pkt.stream_index = asf->stream_index; asf_st->pkt.stream_index = asf->stream_index;
asf_st->packet_pos= asf->packet_pos; asf_st->packet_pos= asf->packet_pos;
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n", //printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment