mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-04 10:57:48 +00:00
Merge remote-tracking branch 'qatar/master'
* qatar/master: tiertexseq: set correct block_align for audio tiertexseq: set audio stream start time to 0 voc/avs: Do not change the sample rate mid-stream. segafilm: use the sample rate as the time base for audio streams ea: fix audio pts psx-str: fix audio pts vqf: set packet duration tta demuxer: set packet duration mpegaudio_parser: do not ignore information from the first parsed frame mpegaudio_parser: be less picky about the start position thp: set audio packet durations avcodec: add a Vorbis parser to get packet duration vorbisdec: read the previous window flag for long windows lavc: free the output packet when encoding failed or produced no output. lavc: preserve avpkt->destruct in ff_alloc_packet(). lavc: clarify the meaning of AVCodecContext.frame_number. mpegts: Pad the packet buffer in handle_packet(). mpegts: Do not call read_sl_header() when no bytes remain in the buffer. Conflicts: libavcodec/mpegaudio_parser.c libavcodec/version.h libavformat/mpegts.c tests/ref/fate/pva-demux Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
15c6be8c7d
24 changed files with 473 additions and 83 deletions
|
@ -945,14 +945,13 @@ int ff_alloc_packet(AVPacket *avpkt, int size)
|
|||
return AVERROR(EINVAL);
|
||||
|
||||
if (avpkt->data) {
|
||||
uint8_t *pkt_data;
|
||||
void *destruct = avpkt->destruct;
|
||||
|
||||
if (avpkt->size < size)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
pkt_data = avpkt->data;
|
||||
av_init_packet(avpkt);
|
||||
avpkt->data = pkt_data;
|
||||
avpkt->destruct = destruct;
|
||||
avpkt->size = size;
|
||||
return 0;
|
||||
} else {
|
||||
|
@ -972,6 +971,7 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
|||
*got_packet_ptr = 0;
|
||||
|
||||
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
|
||||
av_free_packet(avpkt);
|
||||
av_init_packet(avpkt);
|
||||
avpkt->size = 0;
|
||||
return 0;
|
||||
|
@ -1072,6 +1072,9 @@ int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
|
|||
if (!ret)
|
||||
avctx->frame_number++;
|
||||
|
||||
if (ret < 0 || !*got_packet_ptr)
|
||||
av_free_packet(avpkt);
|
||||
|
||||
/* NOTE: if we add any audio encoders which output non-keyframe packets,
|
||||
this needs to be moved to the encoders, but for now we can do it
|
||||
here to simplify things */
|
||||
|
@ -1203,6 +1206,7 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
|
|||
*got_packet_ptr = 0;
|
||||
|
||||
if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) {
|
||||
av_free_packet(avpkt);
|
||||
av_init_packet(avpkt);
|
||||
avpkt->size = 0;
|
||||
return 0;
|
||||
|
@ -1230,6 +1234,9 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
|
|||
avctx->frame_number++;
|
||||
}
|
||||
|
||||
if (ret < 0 || !*got_packet_ptr)
|
||||
av_free_packet(avpkt);
|
||||
|
||||
emms_c();
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue