mirror of
https://github.com/librempeg/librempeg
synced 2024-11-22 09:02:20 +00:00
5626772ac8
- Remove the 1024 cap on the number of samples, for high sample rate audio it was suboptimal, calculate the low neighbour power of two for the number of samples (audio blocks) instead. - Make the function work correctly also for non-pcm codecs by using the stream bitrate to estimate the target packet size. A previous version of this patch used av_get_audio_frame_duration2() the estimate the desired packet size, but for some codecs that returns the duration of a single audio frame regardless of frame_bytes. - Fallback to 4096/block_align*block_align if bitrate is not available. Signed-off-by: Marton Balint <cus@passwd.hu> Signed-off-by: Paul B Mahol <onemda@gmail.com>
33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
/*
|
|
* PCM common functions
|
|
* Copyright (C) 2007 Aurelien Jacobs <aurel@gnuage.org>
|
|
*
|
|
* This file is part of FFmpeg.
|
|
*
|
|
* FFmpeg 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,
|
|
* 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
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
#ifndef AVFORMAT_PCM_H
|
|
#define AVFORMAT_PCM_H
|
|
|
|
#include "avformat.h"
|
|
|
|
int ff_pcm_default_packet_size(AVCodecParameters *par);
|
|
int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt);
|
|
int ff_pcm_read_seek(AVFormatContext *s,
|
|
int stream_index, int64_t timestamp, int flags);
|
|
|
|
#endif /* AVFORMAT_PCM_H */
|