Mercurial > mplayer.hg
annotate libmpdemux/aac_hdr.c @ 33526:140525bcc32f
Fix GUI icon bug.
The GUI icon did not display properly but showed up with various distortions.
The reason was the icon mask which hadn't been put to the X server yet when
used.
The icon itself was okay, but is rendered now in a way that doesn't need a
drawable which spares creating a GTK window and destroying it right after.
The locally used GDK variables have been moved inside the function where
they are needed.
Patch with grateful support by Steaphan Greene, sgreene cs.binghamton edu.
This closes Bugzilla #582.
author | ib |
---|---|
date | Tue, 14 Jun 2011 17:51:17 +0000 |
parents | 928359c13d93 |
children | e5fc26f7067a |
rev | line source |
---|---|
26327
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
1 /* |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
2 * Copyright (C) 2005 Nico Sabbi |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
3 * |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
4 * This file is part of MPlayer. |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
5 * |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
6 * MPlayer is free software; you can redistribute it and/or modify |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
7 * it under the terms of the GNU General Public License as published by |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
8 * the Free Software Foundation; either version 2 of the License, or |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
9 * (at your option) any later version. |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
10 * |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
11 * MPlayer is distributed in the hope that it will be useful, |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
14 * GNU General Public License for more details. |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
15 * |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
16 * You should have received a copy of the GNU General Public License along |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
19 */ |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
20 |
30548
cbbbe3d58f4c
Remove pointless header #includes; #include only required header stdint.h.
diego
parents:
29263
diff
changeset
|
21 #include <stdint.h> |
30574
928359c13d93
Add separate header for aac_parse_frame(); avoids forward declarations.
diego
parents:
30548
diff
changeset
|
22 #include "aac_hdr.h" |
26327
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
23 |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
24 /// \param srate (out) sample rate |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
25 /// \param num (out) number of audio frames in this ADTS frame |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
26 /// \return size of the ADTS frame in bytes |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
27 /// aac_parse_frames needs a buffer at least 8 bytes long |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
28 int aac_parse_frame(uint8_t *buf, int *srate, int *num) |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
29 { |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
30 int i = 0, sr, fl = 0, id; |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
31 static int srates[] = {96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 0, 0, 0}; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26327
diff
changeset
|
32 |
26327
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
33 if((buf[i] != 0xFF) || ((buf[i+1] & 0xF6) != 0xF0)) |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
34 return 0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
26327
diff
changeset
|
35 |
26327
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
36 id = (buf[i+1] >> 3) & 0x01; //id=1 mpeg2, 0: mpeg4 |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
37 sr = (buf[i+2] >> 2) & 0x0F; |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
38 if(sr > 11) |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
39 return 0; |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
40 *srate = srates[sr]; |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
41 |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
42 fl = ((buf[i+3] & 0x03) << 11) | (buf[i+4] << 3) | ((buf[i+5] >> 5) & 0x07); |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
43 *num = (buf[i+6] & 0x02) + 1; |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
44 |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
45 return fl; |
fa91545f01bb
Split the aac header parsing out of aac demuxer to allow using libmpmux
albeu
parents:
diff
changeset
|
46 } |