rewrote debug message handler

This commit is contained in:
itsmattkc
2019-01-12 00:54:39 +11:00
parent 0be6130861
commit 9924315508
26 changed files with 301 additions and 231 deletions
+3 -3
View File
@@ -53,7 +53,7 @@ void PreviewGenerator::parse_media() {
for (int i=0;i<(int)fmt_ctx->nb_streams;i++) {
// Find the decoder for the video stream
if (avcodec_find_decoder(fmt_ctx->streams[i]->codecpar->codec_id) == NULL) {
dout << "[ERROR] Unsupported codec in stream" << i << "of file" << footage->name;
qCritical() << "Unsupported codec in stream" << i << "of file" << footage->name;
} else {
FootageStream ms;
ms.preview_done = false;
@@ -253,13 +253,13 @@ void PreviewGenerator::generate_waveform() {
if (read_ret < 0) {
end_of_file = true;
if (read_ret != AVERROR_EOF) dout << "[ERROR] Failed to read packet for preview generation" << read_ret;
if (read_ret != AVERROR_EOF) qCritical() << "Failed to read packet for preview generation" << read_ret;
break;
}
if (codec_ctx[packet->stream_index] != NULL) {
int send_ret = avcodec_send_packet(codec_ctx[packet->stream_index], packet);
if (send_ret < 0 && send_ret != AVERROR(EAGAIN)) {
dout << "[ERROR] Failed to send packet for preview generation - aborting" << send_ret;
qCritical() << "Failed to send packet for preview generation - aborting" << send_ret;
end_of_file = true;
break;
}