summaryrefslogtreecommitdiffstats
path: root/src/mpeg.c
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-11-12 16:30:30 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-11-12 16:30:30 +0100
commit96b4dc4efca1b164f79a7f7394449866f034ac31 (patch)
tree101b796f40fee444c8193ccc3e13cf5644c83d5f /src/mpeg.c
parent5132756f09c7a0dafe4644db92718ee3d1a58d6c (diff)
parentfedab89cd4625617b3e481f1f59ba0fc97b7305b (diff)
downloaddabmux-96b4dc4efca1b164f79a7f7394449866f034ac31.tar.gz
dabmux-96b4dc4efca1b164f79a7f7394449866f034ac31.tar.bz2
dabmux-96b4dc4efca1b164f79a7f7394449866f034ac31.zip
Merge branch 'next' into servicelinking
Diffstat (limited to 'src/mpeg.c')
-rw-r--r--src/mpeg.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mpeg.c b/src/mpeg.c
index f7aed34..a48f5bb 100644
--- a/src/mpeg.c
+++ b/src/mpeg.c
@@ -219,3 +219,29 @@ int readMpegFrame(int file, void* data, int size)
}
return framelength;
}
+
+int checkDabMpegFrame(void* data) {
+ mpegHeader* header = (mpegHeader*)data;
+ unsigned long* headerData = (unsigned long*)data;
+ if ((*headerData & 0x0f0ffcff) == 0x0004fcff) return 0;
+ if ((*headerData & 0x0f0ffcff) == 0x0004f4ff) return 0;
+ if (getMpegFrequency(header) != 48000) {
+ if (getMpegFrequency(header) != 24000) {
+ return MPEG_FREQUENCY;
+ }
+ }
+ if (header->padding != 0) {
+ return MPEG_PADDING;
+ }
+ if (header->emphasis != 0) {
+ return MPEG_EMPHASIS;
+ }
+ if (header->copyright != 0) {
+ return MPEG_COPYRIGHT;
+ }
+ if (header->original != 0) {
+ return MPEG_ORIGINAL;
+ }
+ return -1;
+}
+