mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add debug information about crash in ffmpeg.
This commit is contained in:
@@ -22,6 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
#include <signal.h>
|
||||
#include <new>
|
||||
#include <mutex>
|
||||
|
||||
#include "platform/platform_specific.h"
|
||||
#include "mtproto/connection.h"
|
||||
@@ -630,6 +631,7 @@ namespace internal {
|
||||
using Annotations = std::map<std::string, std::string>;
|
||||
using AnnotationRefs = std::map<std::string, const QString*>;
|
||||
|
||||
std::mutex ProcessAnnotationsMutex;
|
||||
Annotations ProcessAnnotations;
|
||||
AnnotationRefs ProcessAnnotationRefs;
|
||||
|
||||
@@ -1125,6 +1127,7 @@ namespace internal {
|
||||
}
|
||||
|
||||
void setCrashAnnotation(const std::string &key, const QString &value) {
|
||||
std::unique_lock<std::mutex> lock(internal::ProcessAnnotationsMutex);
|
||||
if (!value.trimmed().isEmpty()) {
|
||||
internal::ProcessAnnotations[key] = value.toUtf8().constData();
|
||||
} else {
|
||||
@@ -1133,6 +1136,7 @@ namespace internal {
|
||||
}
|
||||
|
||||
void setCrashAnnotationRef(const std::string &key, const QString *valuePtr) {
|
||||
std::unique_lock<std::mutex> lock(internal::ProcessAnnotationsMutex);
|
||||
if (valuePtr) {
|
||||
internal::ProcessAnnotationRefs[key] = valuePtr;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user