diff options
author | ceros7 <ceros7@svn> | 2010-02-09 06:06:22 +0000 |
---|---|---|
committer | ceros7 <ceros7@svn> | 2010-02-09 06:06:22 +0000 |
commit | b85501d1427168c4acf625306b75aa22a55ddc69 (patch) | |
tree | faa0699da6a0f360be2deab0360a843c570e41bb /lib/xbmc-dll-symbols | |
parent | 341f651cb7a1bbe380a6217ed036ea5481cbaa11 (diff) |
Define av_read_frame_flush() ourselves when using external ffmpeg.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27594 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'lib/xbmc-dll-symbols')
-rw-r--r-- | lib/xbmc-dll-symbols/DllAvFormat.c | 83 | ||||
-rw-r--r-- | lib/xbmc-dll-symbols/Makefile | 6 |
2 files changed, 89 insertions, 0 deletions
diff --git a/lib/xbmc-dll-symbols/DllAvFormat.c b/lib/xbmc-dll-symbols/DllAvFormat.c new file mode 100644 index 0000000000..8d50ec0a8e --- /dev/null +++ b/lib/xbmc-dll-symbols/DllAvFormat.c @@ -0,0 +1,83 @@ +/* + * various utility functions used within FFmpeg + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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 + */ + +/* Functions defined here are functions that cannot be resolved through the + * ffmpeg shared libraries, yet are used in XBMC. + */ + +#if (defined HAVE_CONFIG_H) && (!defined WIN32) + #include "config.h" +#endif +#if (defined USE_EXTERNAL_FFMPEG) +#include <libavformat/avformat.h> + +/* Taken from libavformat/utils.c */ +static void flush_packet_queue(AVFormatContext *s) +{ + AVPacketList *pktl; + + for(;;) { + pktl = s->packet_buffer; + if (!pktl) + break; + s->packet_buffer = pktl->next; + av_free_packet(&pktl->pkt); + av_free(pktl); + } + while(s->raw_packet_buffer){ + pktl = s->raw_packet_buffer; + s->raw_packet_buffer = pktl->next; + av_free_packet(&pktl->pkt); + av_free(pktl); + } + s->packet_buffer_end= + s->raw_packet_buffer_end= NULL; +} + +/* Taken from libavformat/utils.c */ +void av_read_frame_flush(AVFormatContext *s) +{ + AVStream *st; + int i, j; + + flush_packet_queue(s); + + s->cur_st = NULL; + + /* for each stream, reset read state */ + for(i = 0; i < s->nb_streams; i++) { + st = s->streams[i]; + + if (st->parser) { + av_parser_close(st->parser); + st->parser = NULL; + av_free_packet(&st->cur_pkt); + } + st->last_IP_pts = AV_NOPTS_VALUE; + st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */ + st->reference_dts = AV_NOPTS_VALUE; + /* fail safe */ + st->cur_ptr = NULL; + st->cur_len = 0; + + for(j=0; j<MAX_REORDER_DELAY+1; j++) + st->pts_buffer[j]= AV_NOPTS_VALUE; + } +} +#endif /* (defined USE_EXTERNAL_FFMPEG) */ diff --git a/lib/xbmc-dll-symbols/Makefile b/lib/xbmc-dll-symbols/Makefile new file mode 100644 index 0000000000..d3e51983b6 --- /dev/null +++ b/lib/xbmc-dll-symbols/Makefile @@ -0,0 +1,6 @@ +SRCS = DllAvFormat.c + +LIB = dll-symbols.a + +include ../../Makefile.include +-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) |