Skip to content

Commit dd44586

Browse files
Oleksandr Voietsafacebook-github-bot
Oleksandr Voietsa
authored andcommitted
Add more logging information for decoder
Differential Revision: D36671123 fbshipit-source-id: eb99f293978ed150bca60073115971586f0fa02a
1 parent 74b3f94 commit dd44586

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

torchvision/csrc/io/decoder/decoder.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ int Decoder::getFrame(size_t workingTimeInMs) {
488488
AVPacket* avPacket;
489489
avPacket = av_packet_alloc();
490490
if (avPacket == nullptr) {
491-
LOG(ERROR) << "decoder as not able to allocate the packet.";
491+
LOG(ERROR) << "uuid=" << params_.loggingUuid
492+
<< " decoder as not able to allocate the packet.";
492493
return AVERROR_BUFFER_TOO_SMALL;
493494
}
494495
avPacket->data = nullptr;
@@ -506,6 +507,7 @@ int Decoder::getFrame(size_t workingTimeInMs) {
506507
bool decodedFrame = false;
507508
while (!interrupted_ && inRange_.any() && !decodedFrame) {
508509
if (watcher() == false) {
510+
LOG(ERROR) << "uuid=" << params_.loggingUuid << " hit ETIMEDOUT";
509511
result = ETIMEDOUT;
510512
break;
511513
}
@@ -522,7 +524,8 @@ int Decoder::getFrame(size_t workingTimeInMs) {
522524
break;
523525
} else if (result < 0) {
524526
flushStreams();
525-
LOG(ERROR) << "Error detected: " << Util::generateErrorDesc(result);
527+
LOG(ERROR) << "uuid=" << params_.loggingUuid
528+
<< " error detected: " << Util::generateErrorDesc(result);
526529
break;
527530
}
528531

@@ -543,7 +546,8 @@ int Decoder::getFrame(size_t workingTimeInMs) {
543546
// packet either got consumed completely or not at all
544547
if ((result = processPacket(
545548
stream, avPacket, &gotFrame, &hasMsg, params_.fastSeek)) < 0) {
546-
LOG(ERROR) << "processPacket failed with code: " << result;
549+
LOG(ERROR) << "uuid=" << params_.loggingUuid
550+
<< " processPacket failed with code: " << result;
547551
break;
548552
}
549553

0 commit comments

Comments
 (0)