diff options
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r-- | libavcodec/parser.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c index 03f327efd0..127ba8bd3d 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -3,20 +3,20 @@ * Copyright (c) 2003 Fabrice Bellard * Copyright (c) 2003 Michael Niedermayer * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * 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. * - * Libav is distributed in the hope that it will be useful, + * 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 Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -61,13 +61,13 @@ AVCodecParserContext *av_parser_init(int codec_id) if (!s) return NULL; s->parser = parser; - if (parser->priv_data_size) { - s->priv_data = av_mallocz(parser->priv_data_size); - if (!s->priv_data) { - av_free(s); - return NULL; - } + s->priv_data = av_mallocz(parser->priv_data_size); + if (!s->priv_data) { + av_free(s); + return NULL; } + s->fetch_timestamp=1; + s->pict_type = AV_PICTURE_TYPE_I; if (parser->parser_init) { ret = parser->parser_init(s); if (ret != 0) { @@ -76,8 +76,6 @@ AVCodecParserContext *av_parser_init(int codec_id) return NULL; } } - s->fetch_timestamp=1; - s->pict_type = AV_PICTURE_TYPE_I; s->key_frame = -1; s->convergence_duration = 0; s->dts_sync_point = INT_MIN; @@ -96,7 +94,7 @@ void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove){ if ( s->cur_offset + off >= s->cur_frame_offset[i] && (s->frame_offset < s->cur_frame_offset[i] || (!s->frame_offset && !s->next_frame_offset)) // first field/frame - //check is disabled because mpeg-ts doesnt send complete PES packets + //check is disabled because mpeg-ts doesn't send complete PES packets && /*s->next_frame_offset + off <*/ s->cur_frame_end[i]){ s->dts= s->cur_frame_dts[i]; s->pts= s->cur_frame_pts[i]; @@ -263,6 +261,7 @@ int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_s if(!new_buffer) return AVERROR(ENOMEM); pc->buffer = new_buffer; + if(FF_INPUT_BUFFER_PADDING_SIZE > -next) memcpy(&pc->buffer[pc->index], *buf, next + FF_INPUT_BUFFER_PADDING_SIZE ); pc->index = 0; *buf= pc->buffer; |