comparison avienc.c @ 914:ef25e246c7f2 libavformat

avoid using non constant fields of AVCodecContext in avi muxer
author michael
date Wed, 25 Jan 2006 17:14:16 +0000
parents edbe5c3717f9
children 061718a23581
comparison
equal deleted inserted replaced
913:97a083dcfb7b 914:ef25e246c7f2
611 if (avi->frames_hdr_strm[n] != 0) { 611 if (avi->frames_hdr_strm[n] != 0) {
612 stream = s->streams[n]->codec; 612 stream = s->streams[n]->codec;
613 url_fseek(pb, avi->frames_hdr_strm[n], SEEK_SET); 613 url_fseek(pb, avi->frames_hdr_strm[n], SEEK_SET);
614 ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale); 614 ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
615 if (au_ssize == 0) { 615 if (au_ssize == 0) {
616 put_le32(pb, stream->frame_number); 616 put_le32(pb, avi->packet_count[n]);
617 nb_frames += stream->frame_number; 617 nb_frames += avi->packet_count[n];
618 } else { 618 } else {
619 put_le32(pb, avi->audio_strm_length[n] / au_ssize); 619 put_le32(pb, avi->audio_strm_length[n] / au_ssize);
620 } 620 }
621 } 621 }
622 } 622 }
728 url_fskip(pb, 16); 728 url_fskip(pb, 16);
729 729
730 for (n=nb_frames=0;n<s->nb_streams;n++) { 730 for (n=nb_frames=0;n<s->nb_streams;n++) {
731 AVCodecContext *stream = s->streams[n]->codec; 731 AVCodecContext *stream = s->streams[n]->codec;
732 if (stream->codec_type == CODEC_TYPE_VIDEO) { 732 if (stream->codec_type == CODEC_TYPE_VIDEO) {
733 if (nb_frames < stream->frame_number) 733 if (nb_frames < avi->packet_count[n])
734 nb_frames = stream->frame_number; 734 nb_frames = avi->packet_count[n];
735 } else { 735 } else {
736 if (stream->codec_id == CODEC_ID_MP2 || stream->codec_id == CODEC_ID_MP3) { 736 if (stream->codec_id == CODEC_ID_MP2 || stream->codec_id == CODEC_ID_MP3) {
737 nb_frames += stream->frame_number; 737 nb_frames += avi->packet_count[n];
738 } 738 }
739 } 739 }
740 } 740 }
741 put_le32(pb, nb_frames); 741 put_le32(pb, nb_frames);
742 url_fseek(pb, file_size, SEEK_SET); 742 url_fseek(pb, file_size, SEEK_SET);