return NULL;
}
-/* memory handling */
+#if LIBAVFORMAT_VERSION_MAJOR < 53 && CONFIG_SHARED && HAVE_SYMVER
+FF_SYMVER(void, av_destruct_packet_nofree, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+ av_destruct_packet_nofree(pkt);
+}
+
+FF_SYMVER(void, av_destruct_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+ av_destruct_packet(pkt);
+}
+
+FF_SYMVER(int, av_new_packet, (AVPacket *pkt, int size), "LIBAVFORMAT_52")
+{
+ return av_new_packet(pkt, size);
+}
+FF_SYMVER(int, av_dup_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+ return av_dup_packet(pkt);
+}
+
+FF_SYMVER(void, av_free_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+ av_free_packet(pkt);
+}
+
+FF_SYMVER(void, av_init_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+ av_log(NULL, AV_LOG_WARNING, "Diverting av_*_packet function calls to libavcodec. Recompile to improve performance\n");
+ av_init_packet(pkt);
+}
+#endif
int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size)
{
if(pkt->data == st->cur_pkt.data && pkt->size == st->cur_pkt.size){
s->cur_st = NULL;
pkt->destruct= st->cur_pkt.destruct;
- st->cur_pkt.destruct=
+ st->cur_pkt.destruct= NULL;
st->cur_pkt.data = NULL;
assert(st->cur_len == 0);
}else{
AVPacket *next_pkt= &pktl->pkt;
if(genpts && next_pkt->dts != AV_NOPTS_VALUE){
+ int wrap_bits = s->streams[next_pkt->stream_index]->pts_wrap_bits;
while(pktl && next_pkt->pts == AV_NOPTS_VALUE){
if( pktl->pkt.stream_index == next_pkt->stream_index
- && next_pkt->dts < pktl->pkt.dts
- && pktl->pkt.pts != pktl->pkt.dts //not b frame
- /*&& pktl->pkt.dts != AV_NOPTS_VALUE*/){
+ && (0 > av_compare_mod(next_pkt->dts, pktl->pkt.dts, 2LL << (wrap_bits - 1)))
+ && av_compare_mod(pktl->pkt.pts, pktl->pkt.dts, 2LL << (wrap_bits - 1))) { //not b frame
next_pkt->pts= pktl->pkt.dts;
}
pktl= pktl->next;
/*******************************************************/
/**
- * Returns TRUE if the stream has accurate duration in any stream.
+ * Return TRUE if the stream has accurate duration in any stream.
*
* @return TRUE if the stream has accurate duration for at least one component.
*/
AVStream *st;
int i;
- if (s->nb_streams >= MAX_STREAMS)
+ if (s->nb_streams >= MAX_STREAMS){
+ av_log(s, AV_LOG_ERROR, "Too many streams\n");
return NULL;
+ }
st = av_mallocz(sizeof(AVStream));
if (!st)
}
if(s->oformat->codec_tag){
+ if(st->codec->codec_tag && st->codec->codec_id == CODEC_ID_RAWVIDEO && av_codec_get_tag(s->oformat->codec_tag, st->codec->codec_id) == 0 && !validate_codec_tag(s, st)){
+ //the current rawvideo encoding system ends up setting the wrong codec_tag for avi, we override it here
+ st->codec->codec_tag= 0;
+ }
if(st->codec->codec_tag){
if (!validate_codec_tag(s, st)) {
+ char tagbuf[32];
+ av_get_codec_tag_string(tagbuf, sizeof(tagbuf), st->codec->codec_tag);
av_log(s, AV_LOG_ERROR,
- "Tag 0x%08x incompatible with output codec\n",
- st->codec->codec_tag);
+ "Tag %s/0x%08x incompatible with output codec '%s'\n",
+ tagbuf, st->codec->codec_tag, st->codec->codec->name);
return AVERROR_INVALIDDATA;
}
}else
}
/**
- * Interleaves an AVPacket correctly so it can be muxed.
+ * Interleave an AVPacket correctly so it can be muxed.
* @param out the interleaved packet will be output here
* @param in the input packet
* @param flush 1 if no further packets are available as input and all
pkt_dump_internal(avcl, NULL, level, pkt, dump_payload);
}
+#if LIBAVFORMAT_VERSION_MAJOR < 53
+attribute_deprecated
void ff_url_split(char *proto, int proto_size,
char *authorization, int authorization_size,
char *hostname, int hostname_size,
int *port_ptr,
char *path, int path_size,
const char *url)
+{
+ av_url_split(proto, proto_size,
+ authorization, authorization_size,
+ hostname, hostname_size,
+ port_ptr,
+ path, path_size,
+ url);
+}
+#endif
+
+void av_url_split(char *proto, int proto_size,
+ char *authorization, int authorization_size,
+ char *hostname, int hostname_size,
+ int *port_ptr,
+ char *path, int path_size,
+ const char *url)
{
const char *p, *ls, *at, *col, *brk;
str[0] = '\0';
if (proto)
av_strlcatf(str, size, "%s://", proto);
- if (authorization)
+ if (authorization && authorization[0])
av_strlcatf(str, size, "%s@", authorization);
#if CONFIG_NETWORK && defined(AF_INET6)
/* Determine if hostname is a numerical IPv6 address,