|
|
|
@ -195,9 +195,9 @@ bool DecodeStream::isValidAVFrame(AVFrame *frame) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 如果需要,添加更多判断条件,例如时间戳或关键帧检查
|
|
|
|
|
if (frame->pts == AV_NOPTS_VALUE) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// if (frame->pts == AV_NOPTS_VALUE) {
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return true; // 如果所有条件都通过,则认为 AVFrame 有效
|
|
|
|
|
}
|
|
|
|
@ -214,10 +214,10 @@ bool DecodeStream::isValidAVPacket(AVPacket *pkt) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查时间戳
|
|
|
|
|
if (pkt->pts == AV_NOPTS_VALUE || pkt->dts == AV_NOPTS_VALUE) {
|
|
|
|
|
qDebug() << "Invalid AVPacket: pts or dts is AV_NOPTS_VALUE.\n";
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// if (pkt->pts == AV_NOPTS_VALUE || pkt->dts == AV_NOPTS_VALUE) {
|
|
|
|
|
// qDebug() << "Invalid AVPacket: pts or dts is AV_NOPTS_VALUE.\n";
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 检查流索引(如果是多流)
|
|
|
|
|
if (pkt->stream_index < 0) {
|
|
|
|
|