summaryrefslogtreecommitdiff
path: root/media/libnestegg/mcp-avcaacsupport.patch
blob: 279af76820b94670aad08caf5c7ea23e419f2355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff -u /include/nestegg.h /include/nestegg.h
--- /include/nestegg.h
+++ /include/nestegg.h
@@ -72,6 +72,8 @@
 #define NESTEGG_CODEC_VP9     2       /**< Track uses Google On2 VP9 codec. */
 #define NESTEGG_CODEC_OPUS    3       /**< Track uses Xiph Opus codec. */
 #define NESTEGG_CODEC_AV1     4       /**< Track uses AOMedia AV1 codec. */
+#define NESTEGG_CODEC_AVC1    5       /**< Track uses AVC1 'h264' codec. */
+#define NESTEGG_CODEC_AAC     6       /**< Track uses AAC 'mp4a' codec. */
 #define NESTEGG_CODEC_UNKNOWN INT_MAX /**< Track uses unknown codec. */
 
 #define NESTEGG_VIDEO_MONO              0 /**< Track is mono video. */
diff -u /src/nestegg.c /src/nestegg.c
--- /src/nestegg.c
+++ /src/nestegg.c
@@ -177,6 +177,8 @@
 #define TRACK_ID_AV1                "V_AV1"
 #define TRACK_ID_VORBIS             "A_VORBIS"
 #define TRACK_ID_OPUS               "A_OPUS"
+#define TRACK_ID_AVC1               "V_MPEG4/ISO/AVC"
+#define TRACK_ID_AAC                "A_AAC"
 
 /* Track Encryption */
 #define CONTENT_ENC_ALGO_AES        5
@@ -2482,6 +2484,12 @@
   if (strcmp(codec_id, TRACK_ID_OPUS) == 0)
     return NESTEGG_CODEC_OPUS;
 
+  if (strcmp(codec_id, TRACK_ID_AVC1) == 0)
+    return NESTEGG_CODEC_AVC1;
+
+  if (strcmp(codec_id, TRACK_ID_AAC) == 0)
+    return NESTEGG_CODEC_AAC;
+
   return NESTEGG_CODEC_UNKNOWN;
 }
 
@@ -2502,7 +2510,8 @@
 
   codec_id = nestegg_track_codec_id(ctx, track);
 
-  if (codec_id == NESTEGG_CODEC_OPUS) {
+  if (codec_id == NESTEGG_CODEC_OPUS ||
+      codec_id == NESTEGG_CODEC_AAC) {
     *count = 1;
     return 0;
   }
@@ -2540,7 +2549,9 @@
     return -1;
 
   if (nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_VORBIS &&
-      nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_OPUS)
+      nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_OPUS &&
+      nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_AVC1 &&
+      nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_AAC)
     return -1;
 
   if (ne_get_binary(entry->codec_private, &codec_private) != 0)