Mercurial > libavformat.hg
comparison asf-enc.c @ 1782:4f4edbced58a libavformat
dont set the keyframe flag for audio as microshitty doesnt do it and some things have problems with our asfs, maybe that has a positive effect?
author | michael |
---|---|
date | Mon, 12 Feb 2007 19:24:53 +0000 |
parents | 3562fd629c37 |
children | 82809df9668b |
comparison
equal
deleted
inserted
replaced
1781:ce4617062f7b | 1782:4f4edbced58a |
---|---|
713 ASFStream *stream; | 713 ASFStream *stream; |
714 int64_t duration; | 714 int64_t duration; |
715 AVCodecContext *codec; | 715 AVCodecContext *codec; |
716 int64_t packet_st,pts; | 716 int64_t packet_st,pts; |
717 int start_sec,i; | 717 int start_sec,i; |
718 int flags= pkt->flags; | |
718 | 719 |
719 codec = s->streams[pkt->stream_index]->codec; | 720 codec = s->streams[pkt->stream_index]->codec; |
720 stream = &asf->streams[pkt->stream_index]; | 721 stream = &asf->streams[pkt->stream_index]; |
722 | |
723 if(codec->codec_type == CODEC_TYPE_AUDIO) | |
724 flags &= ~PKT_FLAG_KEY; | |
721 | 725 |
722 //XXX /FIXME use duration from AVPacket (quick hack by) | 726 //XXX /FIXME use duration from AVPacket (quick hack by) |
723 pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; | 727 pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; |
724 assert(pts != AV_NOPTS_VALUE); | 728 assert(pts != AV_NOPTS_VALUE); |
725 duration = pts * 10000; | 729 duration = pts * 10000; |
726 asf->duration= FFMAX(asf->duration, duration); | 730 asf->duration= FFMAX(asf->duration, duration); |
727 | 731 |
728 packet_st = asf->nb_packets; | 732 packet_st = asf->nb_packets; |
729 put_frame(s, stream, pkt->dts, pkt->data, pkt->size, pkt->flags); | 733 put_frame(s, stream, pkt->dts, pkt->data, pkt->size, flags); |
730 | 734 |
731 /* check index */ | 735 /* check index */ |
732 if ((!asf->is_streamed) && (codec->codec_type == CODEC_TYPE_VIDEO) && (pkt->flags & PKT_FLAG_KEY)) { | 736 if ((!asf->is_streamed) && (flags & PKT_FLAG_KEY)) { |
733 start_sec = (int)(duration / INT64_C(10000000)); | 737 start_sec = (int)(duration / INT64_C(10000000)); |
734 if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) { | 738 if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) { |
735 for(i=asf->nb_index_count;i<start_sec;i++) { | 739 for(i=asf->nb_index_count;i<start_sec;i++) { |
736 if (i>=asf->nb_index_memory_alloc) { | 740 if (i>=asf->nb_index_memory_alloc) { |
737 asf->nb_index_memory_alloc += ASF_INDEX_BLOCK; | 741 asf->nb_index_memory_alloc += ASF_INDEX_BLOCK; |