Revision 0d9f8633 libavformat/asf-enc.c

View differences:

libavformat/asf-enc.c
715 715
    AVCodecContext *codec;
716 716
    int64_t packet_st,pts;
717 717
    int start_sec,i;
718
    int flags= pkt->flags;
718 719

  
719 720
    codec = s->streams[pkt->stream_index]->codec;
720 721
    stream = &asf->streams[pkt->stream_index];
721 722

  
723
    if(codec->codec_type == CODEC_TYPE_AUDIO)
724
        flags &= ~PKT_FLAG_KEY;
725

  
722 726
    //XXX /FIXME use duration from AVPacket (quick hack by)
723 727
    pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts;
724 728
    assert(pts != AV_NOPTS_VALUE);
......
726 730
    asf->duration= FFMAX(asf->duration, duration);
727 731

  
728 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 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 737
        start_sec = (int)(duration / INT64_C(10000000));
734 738
        if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) {
735 739
            for(i=asf->nb_index_count;i<start_sec;i++) {

Also available in: Unified diff