Skip to content

Commit

Permalink
Add more logging information for decoder
Browse files Browse the repository at this point in the history
Differential Revision: D36671123

fbshipit-source-id: eb99f293978ed150bca60073115971586f0fa02a
  • Loading branch information
Oleksandr Voietsa authored and facebook-github-bot committed May 25, 2022
1 parent 74b3f94 commit dd44586
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions torchvision/csrc/io/decoder/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ int Decoder::getFrame(size_t workingTimeInMs) {
AVPacket* avPacket;
avPacket = av_packet_alloc();
if (avPacket == nullptr) {
LOG(ERROR) << "decoder as not able to allocate the packet.";
LOG(ERROR) << "uuid=" << params_.loggingUuid
<< " decoder as not able to allocate the packet.";
return AVERROR_BUFFER_TOO_SMALL;
}
avPacket->data = nullptr;
Expand All @@ -506,6 +507,7 @@ int Decoder::getFrame(size_t workingTimeInMs) {
bool decodedFrame = false;
while (!interrupted_ && inRange_.any() && !decodedFrame) {
if (watcher() == false) {
LOG(ERROR) << "uuid=" << params_.loggingUuid << " hit ETIMEDOUT";
result = ETIMEDOUT;
break;
}
Expand All @@ -522,7 +524,8 @@ int Decoder::getFrame(size_t workingTimeInMs) {
break;
} else if (result < 0) {
flushStreams();
LOG(ERROR) << "Error detected: " << Util::generateErrorDesc(result);
LOG(ERROR) << "uuid=" << params_.loggingUuid
<< " error detected: " << Util::generateErrorDesc(result);
break;
}

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

Expand Down

0 comments on commit dd44586

Please sign in to comment.