Change remaining ost->st->codec and ist->st->codec to enc and dec in
do_audio_out(). Originally committed as revision 25143 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
14
ffmpeg.c
14
ffmpeg.c
@@ -867,9 +867,9 @@ need_realloc:
|
|||||||
|
|
||||||
if(audio_sync_method){
|
if(audio_sync_method){
|
||||||
double delta = get_sync_ipts(ost) * enc->sample_rate - ost->sync_opts
|
double delta = get_sync_ipts(ost) * enc->sample_rate - ost->sync_opts
|
||||||
- av_fifo_size(ost->fifo)/(ost->st->codec->channels * 2);
|
- av_fifo_size(ost->fifo)/(enc->channels * 2);
|
||||||
double idelta= delta*ist->st->codec->sample_rate / enc->sample_rate;
|
double idelta= delta*dec->sample_rate / enc->sample_rate;
|
||||||
int byte_delta= ((int)idelta)*2*ist->st->codec->channels;
|
int byte_delta= ((int)idelta)*2*enc->channels;
|
||||||
|
|
||||||
//FIXME resample delay
|
//FIXME resample delay
|
||||||
if(fabs(delta) > 50){
|
if(fabs(delta) > 50){
|
||||||
@@ -911,13 +911,13 @@ need_realloc:
|
|||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
ost->sync_opts= lrintf(get_sync_ipts(ost) * enc->sample_rate)
|
ost->sync_opts= lrintf(get_sync_ipts(ost) * enc->sample_rate)
|
||||||
- av_fifo_size(ost->fifo)/(ost->st->codec->channels * 2); //FIXME wrong
|
- av_fifo_size(ost->fifo)/(enc->channels * 2); //FIXME wrong
|
||||||
|
|
||||||
if (ost->audio_resample) {
|
if (ost->audio_resample) {
|
||||||
buftmp = audio_buf;
|
buftmp = audio_buf;
|
||||||
size_out = audio_resample(ost->resample,
|
size_out = audio_resample(ost->resample,
|
||||||
(short *)buftmp, (short *)buf,
|
(short *)buftmp, (short *)buf,
|
||||||
size / (ist->st->codec->channels * isize));
|
size / (dec->channels * isize));
|
||||||
size_out = size_out * enc->channels * osize;
|
size_out = size_out * enc->channels * osize;
|
||||||
} else {
|
} else {
|
||||||
buftmp = buf;
|
buftmp = buf;
|
||||||
@@ -972,7 +972,7 @@ need_realloc:
|
|||||||
if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
|
if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
|
||||||
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
|
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
|
||||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||||
write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
|
write_frame(s, &pkt, enc, bitstream_filters[ost->file_index][pkt.stream_index]);
|
||||||
|
|
||||||
ost->sync_opts += enc->frame_size;
|
ost->sync_opts += enc->frame_size;
|
||||||
}
|
}
|
||||||
@@ -1007,7 +1007,7 @@ need_realloc:
|
|||||||
if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
|
if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE)
|
||||||
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
|
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base);
|
||||||
pkt.flags |= AV_PKT_FLAG_KEY;
|
pkt.flags |= AV_PKT_FLAG_KEY;
|
||||||
write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]);
|
write_frame(s, &pkt, enc, bitstream_filters[ost->file_index][pkt.stream_index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user