[easytag/wip/opus-support] Improved support for writing Opus Tags
- From: Abhinav Jangda <abhijangda src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/opus-support] Improved support for writing Opus Tags
- Date: Sun, 30 Mar 2014 16:26:07 +0000 (UTC)
commit 93d669e6c2ec091f824e6e25a0163faff08820fa
Author: Abhinav <abhijangda hotmail com>
Date: Sun Mar 30 21:55:16 2014 +0530
Improved support for writing Opus Tags
src/ogg_header.h | 9 ++-------
src/vcedit.c | 16 +++++++++++-----
2 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/src/ogg_header.h b/src/ogg_header.h
index df916fe..0817a31 100644
--- a/src/ogg_header.h
+++ b/src/ogg_header.h
@@ -52,9 +52,7 @@ GQuark et_ogg_error_quark (void);
* @ET_OGG_ERROR_VORBIS: eof before end of Vorbis headers
* @ET_OGG_ERROR_FAILED: corrupt or missing data
* @ET_OGG_ERROR_OUTPUT: error writing stream to output
- * @ET_OGG_OPUS_HEADER_ERROR_FORMAT: Ogg Opus Tags does not starts with "OpusTags"
- * @ET_OGG_OPUS_HEADER_ERROR_FAULT: not enough memory to store Ogg Opus Tags
- * @ET_OGG_OPUS_HEADER_ERROR_BADHEADER: Ogg Opus Tags doesnot follow specifications
+ *
* Errors that can occur when reading OGG files.
*/
typedef enum
@@ -71,10 +69,7 @@ typedef enum
ET_OGG_ERROR_EXTRA,
ET_OGG_ERROR_VORBIS,
ET_OGG_ERROR_FAILED,
- ET_OGG_ERROR_OUTPUT,
- ET_OGG_OPUS_HEADER_ERROR_FORMAT,
- ET_OGG_OPUS_HEADER_ERROR_FAULT,
- ET_OGG_OPUS_HEADER_ERROR_BADHEADER
+ ET_OGG_ERROR_OUTPUT
} EtOGGError;
/**************
diff --git a/src/vcedit.c b/src/vcedit.c
index 5edd9f0..c08eaab 100644
--- a/src/vcedit.c
+++ b/src/vcedit.c
@@ -111,8 +111,8 @@ static int _commentheader_out(vcedit_state *state, ogg_packet *op)
}
#ifdef ENABLE_OPUS
else if (state->oggtype == VCEDIT_IS_OPUS)
- {
- _v_writestring(&opb,"OpusTags", 8);
+ {
+ _v_writestring (&opb, "OpusTags", 8);
}
#endif
@@ -375,10 +375,13 @@ vcedit_open(vcedit_state *state, GFile *file, GError **error)
if (state->oggtype == VCEDIT_IS_UNKNOWN)
{
state->oi = g_malloc (sizeof (OpusHead));
+
if (opus_head_parse (state->oi,
(unsigned char*)(&header_main)->packet,
(&header_main)->bytes) == 0)
+ {
state->oggtype = VCEDIT_IS_OPUS;
+ }
}
#endif
}
@@ -468,21 +471,24 @@ vcedit_open(vcedit_state *state, GFile *file, GError **error)
{
case OP_ENOTFORMAT:
g_set_error (error, ET_OGG_ERROR,
- ET_OGG_OPUS_HEADER_ERROR_FORMAT,
+ ET_OGG_ERROR_HEADER,
"Ogg Opus Tags does not starts with \"OpusTags\"");
goto err;
+ break;
case OP_EFAULT:
g_set_error (error, ET_OGG_ERROR,
- ET_OGG_OPUS_HEADER_ERROR_FAULT,
+ ET_OGG_ERROR_HEADER,
"Not enough memory to store Ogg Opus Tags");
goto err;
+ break;
case OP_EBADHEADER:
g_set_error (error, ET_OGG_ERROR,
- ET_OGG_OPUS_HEADER_ERROR_BADHEADER,
+ ET_OGG_ERROR_HEADER,
"Ogg Opus Tags doesnot follow specifications");
goto err;
+ break;
}
}
i++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]