diff options
| author | Rémi Achard <remi.achard@gmail.com> | 2020-01-23 00:12:49 +0000 |
|---|---|---|
| committer | Rémi Achard <remi.achard@gmail.com> | 2020-01-23 00:12:49 +0000 |
| commit | 1ae4158e789f1baa998126c4780666046933bf23 (patch) | |
| tree | 48fbfa839c639bdbd22b0c9be41d0daa41d8dbd4 /src/TimedText_Parser.cpp | |
| parent | e187a605257a3ff9d8a84d23003a9f2bd13a12ac (diff) | |
Improve error diagnostic in timed text parser
Diffstat (limited to 'src/TimedText_Parser.cpp')
| -rw-r--r-- | src/TimedText_Parser.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/TimedText_Parser.cpp b/src/TimedText_Parser.cpp index 6b6d006..ff53e67 100644 --- a/src/TimedText_Parser.cpp +++ b/src/TimedText_Parser.cpp @@ -380,17 +380,23 @@ ASDCP::TimedText::DCSubtitleParser::h__SubtitleParser::ReadAncillaryResource(con Result_t result = Resolver.ResolveRID(uuid, FrameBuf); + std::string resourceType; + if ( (*rmi).second == MT_PNG ) + resourceType = "image/png"; + else if ( (*rmi).second == MT_OPENTYPE ) + resourceType = "application/x-font-opentype"; + else + resourceType = "application/octet-stream"; + if ( KM_SUCCESS(result) ) { - if ( (*rmi).second == MT_PNG ) - FrameBuf.MIMEType("image/png"); - - else if ( (*rmi).second == MT_OPENTYPE ) - FrameBuf.MIMEType("application/x-font-opentype"); - - else - FrameBuf.MIMEType("application/octet-stream"); + FrameBuf.MIMEType(resourceType); + } + else + { + DefaultLogSink().Error("Resource not found: %s (%s)\n", TmpID.EncodeHex(buf, 64), resourceType.c_str()); } + return result; } |
