deprecate safepkt, not sure why it was needed

This commit is contained in:
Isaac Connor 2016-09-09 10:05:54 -04:00
parent caaaffbb5d
commit 4cfd5cfbb9
1 changed files with 6 additions and 6 deletions

View File

@ -269,7 +269,7 @@ void VideoStore::dumpPacket( AVPacket *pkt ){
Info("%s:%d:DEBUG: %s", __FILE__, __LINE__, b); Info("%s:%d:DEBUG: %s", __FILE__, __LINE__, b);
} }
int VideoStore::writeVideoFramePacket(AVPacket *ipkt, AVStream *input_video_stream){//, AVPacket *lastKeyframePkt){ int VideoStore::writeVideoFramePacket(AVPacket *ipkt, AVStream *input_video_stream){
Debug(2, "writeVideoFrame"); Debug(2, "writeVideoFrame");
Debug(3, "before ost_tbcket starttime %d, timebase%d", startTime, video_stream->time_base ); Debug(3, "before ost_tbcket starttime %d, timebase%d", startTime, video_stream->time_base );
@ -279,7 +279,7 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt, AVStream *input_video_stre
Debug(3, "before ost_tbcket starttime %d, ost_tbcket %d", startTime, ost_tb_start_time ); Debug(3, "before ost_tbcket starttime %d, ost_tbcket %d", startTime, ost_tb_start_time );
Debug(2, "writeVideoFrame"); Debug(2, "writeVideoFrame");
AVPacket opkt, safepkt; AVPacket opkt;
AVPicture pict; AVPicture pict;
Debug(2, "writeVideoFrame init_packet"); Debug(2, "writeVideoFrame init_packet");
@ -321,7 +321,7 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt, AVStream *input_video_stre
opkt.flags |= AV_PKT_FLAG_KEY; opkt.flags |= AV_PKT_FLAG_KEY;
} }
memcpy(&safepkt, &opkt, sizeof(AVPacket)); //memcpy(&safepkt, &opkt, sizeof(AVPacket));
if ((opkt.data == NULL)||(opkt.size < 1)) { if ((opkt.data == NULL)||(opkt.size < 1)) {
Warning("%s:%d: Mangled AVPacket: discarding frame", __FILE__, __LINE__ ); Warning("%s:%d: Mangled AVPacket: discarding frame", __FILE__, __LINE__ );
@ -340,11 +340,11 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt, AVStream *input_video_stre
if(ret<0){ if(ret<0){
// There's nothing we can really do if the frame is rejected, just drop it and get on with the next // There's nothing we can really do if the frame is rejected, just drop it and get on with the next
Warning("%s:%d: Writing frame [av_interleaved_write_frame()] failed: %s(%d) ", __FILE__, __LINE__, av_make_error_string(ret).c_str(), (ret)); Warning("%s:%d: Writing frame [av_interleaved_write_frame()] failed: %s(%d) ", __FILE__, __LINE__, av_make_error_string(ret).c_str(), (ret));
dumpPacket(&safepkt); dumpPacket(&opkt);
} }
} }
av_free_packet(&opkt); zm_av_unref_packet(&opkt);
return 0; return 0;
@ -418,6 +418,6 @@ int VideoStore::writeAudioFramePacket(AVPacket *ipkt, AVStream *input_video_stre
Fatal("Error encoding audio frame packet: %s\n", av_make_error_string(ret).c_str()); Fatal("Error encoding audio frame packet: %s\n", av_make_error_string(ret).c_str());
} }
Debug(4,"Success writing audio frame" ); Debug(4,"Success writing audio frame" );
av_free_packet(&opkt); zm_av_unref_packet(&opkt);
return 0; return 0;
} }