Skip to content

Commit

Permalink
Ignore corrupt packets/frames instead of failing
Browse files Browse the repository at this point in the history
  • Loading branch information
complexlogic committed May 8, 2022
1 parent f5fb742 commit 5af82c6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 239 deletions.
149 changes: 0 additions & 149 deletions README.md.backup

This file was deleted.

85 changes: 0 additions & 85 deletions docs/BUILDING.md.backup

This file was deleted.

7 changes: 2 additions & 5 deletions src/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ bool scan_file(const char *file, unsigned index, std::mutex *m) {
rc = avcodec_send_packet(ctx, &packet);
if (rc < 0) {
output_error("Error while sending a packet to the decoder");
error = true;
break;
continue;
}

while (rc >= 0) {
Expand All @@ -325,8 +324,7 @@ bool scan_file(const char *file, unsigned index, std::mutex *m) {
}
else if (rc < 0) {
output_error("Error while receiving a frame from the decoder");
error = true;
goto end;
break;
}
if (rc >= 0) {
double pos = frame->pkt_dts*av_q2d(container->streams[stream_id]->time_base);
Expand Down Expand Up @@ -392,7 +390,6 @@ bool scan_file(const char *file, unsigned index, std::mutex *m) {
swr_free(&swr);
}


avcodec_close(ctx);
avformat_close_input(&container);

Expand Down

0 comments on commit 5af82c6

Please sign in to comment.