[tracker-miners/sam/file-processed-signal: 8/9] tracker-extract-mp3: Describe error when unable to parse MP3



commit 0e6c18fb0231b0ed4ffc4688a0fcb6ef0b2896ad
Author: Sam Thursfield <sam afuera me uk>
Date:   Sun Mar 22 00:37:14 2020 +0100

    tracker-extract-mp3: Describe error when unable to parse MP3

 src/tracker-extract/tracker-extract-mp3.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 4dcf6107a..c3a1b2cc5 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -39,6 +39,7 @@
 #include <libtracker-miners-common/tracker-common.h>
 
 #include <libtracker-extract/tracker-extract.h>
+#include <tracker-extract/tracker-extract.h>
 
 #ifdef FRAME_ENABLE_TRACE
 #warning Frame traces enabled
@@ -2926,5 +2927,12 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
        g_free (filename);
        g_free (uri);
 
+       if (!parsed) {
+               GError *error = g_error_new (TRACKER_EXTRACT_ERROR,
+                                            TRACKER_EXTRACT_ERROR_PARSE_ERROR,
+                                            "Could not parse file as MP3.");
+               tracker_extract_info_set_error (info, error);
+       }
+
        return parsed;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]