| | 1340 | if (!avfMode) |
| | 1341 | { |
| | 1342 | GetPlayer()->GetCC608Reader()-> |
| | 1343 | TranscodeWriteText(&TranscodeWriteText, (void *)(nvr)); |
| | 1344 | } |
| | 1345 | lasttimecode = frame.timecode; |
| | 1346 | frame.timecode -= timecodeOffset; |
| | 1347 | |
| | 1348 | if (avfMode) |
| | 1349 | { |
| | 1350 | if (halfFramerate && !skippedLastFrame) |
| | 1351 | { |
| | 1352 | skippedLastFrame = true; |
| | 1353 | } |
| | 1354 | else |
| | 1355 | { |
| | 1356 | skippedLastFrame = false; |
| | 1357 | |
| | 1358 | if ((hls) && |
| | 1359 | (avfw->GetFramesWritten()) && |
| | 1360 | (hlsSegmentFrames > hlsSegmentSize) && |
| | 1361 | (avfw->NextFrameIsKeyFrame())) |
| | 1362 | { |
| | 1363 | hls->AddSegment(); |
| | 1364 | avfw->ReOpen(hls->GetCurrentFilename()); |
| | 1365 | |
| | 1366 | if (avfw2) |
| | 1367 | avfw2->ReOpen(hls->GetCurrentFilename(true)); |
| | 1368 | |
| | 1369 | hlsSegmentFrames = 0; |
| | 1370 | } |
| | 1371 | |
| | 1372 | if (avfw->WriteVideoFrame(&frame) > 0) |
| | 1373 | { |
| | 1374 | lastWrittenTime = frame.timecode + timecodeOffset; |
| | 1375 | if (hls) |
| | 1376 | ++hlsSegmentFrames; |
| | 1377 | } |
| | 1378 | |
| | 1379 | } |
| | 1380 | } |
| | 1381 | else |
| | 1382 | { |
| | 1383 | if (forceKeyFrames) |
| | 1384 | nvr->WriteVideo(&frame, true, true); |
| | 1385 | else |
| | 1386 | nvr->WriteVideo(&frame); |
| | 1387 | |
| | 1388 | lastWrittenTime = frame.timecode + timecodeOffset; |
| | 1389 | } |
| | 1390 | |
| 1386 | | if (!avfMode) |
| 1387 | | { |
| 1388 | | GetPlayer()->GetCC608Reader()-> |
| 1389 | | TranscodeWriteText(&TranscodeWriteText, (void *)(nvr)); |
| 1390 | | } |
| 1391 | | lasttimecode = frame.timecode; |
| 1392 | | frame.timecode -= timecodeOffset; |
| 1393 | | |
| 1394 | | if (avfMode) |
| 1395 | | { |
| 1396 | | if (halfFramerate && !skippedLastFrame) |
| 1397 | | { |
| 1398 | | skippedLastFrame = true; |
| 1399 | | } |
| 1400 | | else |
| 1401 | | { |
| 1402 | | skippedLastFrame = false; |
| 1403 | | |
| 1404 | | if ((hls) && |
| 1405 | | (avfw->GetFramesWritten()) && |
| 1406 | | (hlsSegmentFrames > hlsSegmentSize) && |
| 1407 | | (avfw->NextFrameIsKeyFrame())) |
| 1408 | | { |
| 1409 | | hls->AddSegment(); |
| 1410 | | avfw->ReOpen(hls->GetCurrentFilename()); |
| 1411 | | |
| 1412 | | if (avfw2) |
| 1413 | | avfw2->ReOpen(hls->GetCurrentFilename(true)); |
| 1414 | | |
| 1415 | | hlsSegmentFrames = 0; |
| 1416 | | } |
| 1417 | | |
| 1418 | | if (avfw->WriteVideoFrame(&frame) > 0) |
| 1419 | | { |
| 1420 | | lastWrittenTime = frame.timecode; |
| 1421 | | if (hls) |
| 1422 | | ++hlsSegmentFrames; |
| 1423 | | } |
| 1424 | | |
| 1425 | | } |
| 1426 | | } |
| 1427 | | else |
| 1428 | | { |
| 1429 | | if (forceKeyFrames) |
| 1430 | | nvr->WriteVideo(&frame, true, true); |
| 1431 | | else |
| 1432 | | nvr->WriteVideo(&frame); |
| 1433 | | lastWrittenTime = frame.timecode; |
| 1434 | | } |