This commit is contained in:
Isaac Connor 2016-06-21 12:25:13 -04:00
parent 2304806bcc
commit dfc885a12a
1 changed files with 269 additions and 270 deletions

View File

@ -35,7 +35,8 @@ extern "C"{
VideoStore::VideoStore(const char *filename_in, const char *format_in,
AVStream *input_st,
AVStream *inpaud_st,
int64_t nStartTime) {
int64_t nStartTime
) {
AVDictionary *pmetadata = NULL;
int dsr;
@ -267,11 +268,9 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt, AVStream *input_st){//, AV
}
}
av_free_packet(&opkt);
return 0;
}
int VideoStore::writeAudioFramePacket(AVPacket *ipkt, AVStream *input_st){
@ -304,13 +303,13 @@ int VideoStore::writeAudioFramePacket(AVPacket *ipkt, AVStream *input_st){
//Scale the DTS of the outgoing packet to be the correct time base
if(ipkt->dts == AV_NOPTS_VALUE) {
Debug(4, "ipkt->dts == AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
Debug(4, "ipkt->dts == AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
opkt.dts = av_rescale_q(input_st->cur_dts-startDts, AV_TIME_BASE_Q, audio_st->time_base);
Debug(4, "ipkt->dts == AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
Debug(4, "ipkt->dts == AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
} else {
Debug(4, "ipkt->dts != AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
Debug(4, "ipkt->dts != AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
opkt.dts = av_rescale_q(ipkt->dts-startDts, input_st->time_base, audio_st->time_base);
Debug(4, "ipkt->dts != AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
Debug(4, "ipkt->dts != AV_NOPTS_VALUE %d to %d", AV_NOPTS_VALUE, opkt.dts );
}
opkt.dts -= ost_tb_start_time;