X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmpeg.h;h=75dddf346b22781d3d736b95125e75f4ec5f59e9;hb=87199d34db5d79ad85c0801b29db0709c08f458c;hp=053b1590eaf9e5ca6cb0574c85840cb58e61c900;hpb=5b21bdabe43611385d1d55a21d5b1f607b133d29;p=ffmpeg diff --git a/libavformat/mpeg.h b/libavformat/mpeg.h index 053b1590eaf..75dddf346b2 100644 --- a/libavformat/mpeg.h +++ b/libavformat/mpeg.h @@ -1,26 +1,29 @@ /* * MPEG1/2 muxer and demuxer common defines - * Copyright (c) 2000, 2001, 2002 Fabrice Bellard. + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef FFMPEG_MPEG_H -#define FFMPEG_MPEG_H +#ifndef AVFORMAT_MPEG_H +#define AVFORMAT_MPEG_H + +#include +#include "libavutil/intreadwrite.h" #define PACK_START_CODE ((unsigned int)0x000001ba) #define SYSTEM_HEADER_START_CODE ((unsigned int)0x000001bb) @@ -57,4 +60,13 @@ static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 }; -#endif /* FFMPEG_MPEG_H */ +/** + * Parse MPEG-PES five-byte timestamp + */ +static inline int64_t ff_parse_pes_pts(const uint8_t *buf) { + return (int64_t)(*buf & 0x0e) << 29 | + (AV_RB16(buf+1) >> 1) << 15 | + AV_RB16(buf+3) >> 1; +} + +#endif /* AVFORMAT_MPEG_H */