|
|
@ -715,10 +715,14 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) |
|
|
|
AVCodecContext *codec; |
|
|
|
AVCodecContext *codec; |
|
|
|
int64_t packet_st,pts; |
|
|
|
int64_t packet_st,pts; |
|
|
|
int start_sec,i; |
|
|
|
int start_sec,i; |
|
|
|
|
|
|
|
int flags= pkt->flags; |
|
|
|
|
|
|
|
|
|
|
|
codec = s->streams[pkt->stream_index]->codec; |
|
|
|
codec = s->streams[pkt->stream_index]->codec; |
|
|
|
stream = &asf->streams[pkt->stream_index]; |
|
|
|
stream = &asf->streams[pkt->stream_index]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(codec->codec_type == CODEC_TYPE_AUDIO) |
|
|
|
|
|
|
|
flags &= ~PKT_FLAG_KEY; |
|
|
|
|
|
|
|
|
|
|
|
//XXX /FIXME use duration from AVPacket (quick hack by)
|
|
|
|
//XXX /FIXME use duration from AVPacket (quick hack by)
|
|
|
|
pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; |
|
|
|
pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; |
|
|
|
assert(pts != AV_NOPTS_VALUE); |
|
|
|
assert(pts != AV_NOPTS_VALUE); |
|
|
@ -726,10 +730,10 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) |
|
|
|
asf->duration= FFMAX(asf->duration, duration); |
|
|
|
asf->duration= FFMAX(asf->duration, duration); |
|
|
|
|
|
|
|
|
|
|
|
packet_st = asf->nb_packets; |
|
|
|
packet_st = asf->nb_packets; |
|
|
|
put_frame(s, stream, pkt->dts, pkt->data, pkt->size, pkt->flags); |
|
|
|
put_frame(s, stream, pkt->dts, pkt->data, pkt->size, flags); |
|
|
|
|
|
|
|
|
|
|
|
/* check index */ |
|
|
|
/* check index */ |
|
|
|
if ((!asf->is_streamed) && (codec->codec_type == CODEC_TYPE_VIDEO) && (pkt->flags & PKT_FLAG_KEY)) { |
|
|
|
if ((!asf->is_streamed) && (flags & PKT_FLAG_KEY)) { |
|
|
|
start_sec = (int)(duration / INT64_C(10000000)); |
|
|
|
start_sec = (int)(duration / INT64_C(10000000)); |
|
|
|
if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) { |
|
|
|
if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) { |
|
|
|
for(i=asf->nb_index_count;i<start_sec;i++) { |
|
|
|
for(i=asf->nb_index_count;i<start_sec;i++) { |
|
|
|