annotate input/ar.h @ 24589:9118be6575da

demux_audio.c: Fix timestamp handling The code calculated the pts values of audio packets by adding the length of the current packet to the pts of the previous one. The length of the previous packet should be added instead. This broke WAV timestamps near the end of the stream where a short packet occurs. Change the code to store the pts of the next packet instead of the last one. This fixes the WAV timestamps and allows some simplifications. MP3 timestamps are not affected as packets are always treated as constant decoded length, and FLAC timestamps still have worse problems (FLAC is treated as as if it was constant bitrate even though it isn't). Also store the timestamps as double instead of float.
author uau
date Mon, 24 Sep 2007 21:49:56 +0000
parents c7f95196dfe5
children 4129c8cfa742
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24037
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
1 /*
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
2 * Apple Remote input interface
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
3 *
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
4 * Copyright (C) 2007 Zoltan Ponekker <pontscho at kac.poliod.hu>
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
5 *
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
6 * This file is part of MPlayer.
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
7 *
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
11 * (at your option) any later version.
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
12 *
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
16 * GNU General Public License for more details.
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
17 *
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
19 * along with MPlayer; if not, write to the Free Software
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
21 */
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
22
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
23 #ifndef INPUT_AR_H
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
24 #define INPUT_AR_H
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
25
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
26 #define AR_BASE 0x500
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
27 #define AR_PLAY (AR_BASE + 0)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
28 #define AR_PLAY_HOLD (AR_BASE + 1)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
29 #define AR_NEXT (AR_BASE + 2)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
30 #define AR_NEXT_HOLD (AR_BASE + 3)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
31 #define AR_PREV (AR_BASE + 4)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
32 #define AR_PREV_HOLD (AR_BASE + 5)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
33 #define AR_MENU (AR_BASE + 6)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
34 #define AR_MENU_HOLD (AR_BASE + 7)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
35 #define AR_VUP (AR_BASE + 8)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
36 #define AR_VDOWN (AR_BASE + 9)
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
37
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
38 int mp_input_ar_init(void);
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
39 int mp_input_ar_read(int fd);
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
40 void mp_input_ar_close(int fd);
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
41
c7f95196dfe5 Apple Remote support
diego
parents:
diff changeset
42 #endif /* INPUT_AR_H */