History

avserver: fix build after the next bump.

Now that 0.8 is out we can reapply this commit. It breaks shared avserver builds due to avserver using internal libavformat symbols, which are now hidden, so this commit also disables avserver with --enable-shared.

Anton Khirnov committed 14 years ago

Commit b263bf61 parent 58f09782 files · +13 −11Browse files

Unified · Split

2 files
  1. avserver.c +12 −10
  2. configure +1 −1
avserver.c+12−10
@@ -26,13 +26,16 @@ · 25 unmodified lines
2626 #include <string.h>
2727 #include <stdlib.h>
2828 #include "libavformat/avformat.h"
29+// FIXME those are internal headers, avserver _really_ shouldn't use them
2930 #include "libavformat/ffm.h"
3031 #include "libavformat/network.h"
3132 #include "libavformat/os_support.h"
3233 #include "libavformat/rtpdec.h"
3334 #include "libavformat/rtsp.h"
34−// XXX for ffio_open_dyn_packet_buffer, to be removed
3535 #include "libavformat/avio_internal.h"
36+#include "libavformat/internal.h"
37+#include "libavformat/url.h"
38+
3639 #include "libavutil/avstring.h"
3740 #include "libavutil/lfg.h"
3841 #include "libavutil/dict.h"
@@ -867,7 +870,7 @@ static void close_connection(HTTPContext *c) · 828 unmodified lines
867870 }
868871 h = c->rtp_handles[i];
869872 if (h)
870− url_close(h);
873+ ffurl_close(h);
871874 }
872875
873876 ctx = &c->fmt_ctx;
@@ -2248,7 +2251,6 @@ static int http_prepare_data(HTTPContext *c) · 1374 unmodified lines
22482251 * Default value from Libav
22492252 * Try to set it use configuration option
22502253 */
2251− c->fmt_ctx.preload = (int)(0.5*AV_TIME_BASE);
22522254 c->fmt_ctx.max_delay = (int)(0.7*AV_TIME_BASE);
22532255
22542256 if (avformat_write_header(&c->fmt_ctx, NULL) < 0) {
@@ -2367,7 +2369,7 @@ static int http_prepare_data(HTTPContext *c) · 112 unmodified lines
23672369 if (c->rtp_protocol == RTSP_LOWER_TRANSPORT_TCP)
23682370 max_packet_size = RTSP_TCP_MAX_PACKET_SIZE;
23692371 else
2370− max_packet_size = url_get_max_packet_size(c->rtp_handles[c->packet_stream_index]);
2372+ max_packet_size = c->rtp_handles[c->packet_stream_index]->max_packet_size;
23712373 ret = ffio_open_dyn_packet_buf(&ctx->pb, max_packet_size);
23722374 } else {
23732375 ret = avio_open_dyn_buf(&ctx->pb);
@@ -2520,8 +2522,8 @@ static int http_send_data(HTTPContext *c) · 146 unmodified lines
25202522 } else {
25212523 /* send RTP packet directly in UDP */
25222524 c->buffer_ptr += 4;
2523− url_write(c->rtp_handles[c->packet_stream_index],
2524− c->buffer_ptr, len);
2525+ ffurl_write(c->rtp_handles[c->packet_stream_index],
2526+ c->buffer_ptr, len);
25252527 c->buffer_ptr += len;
25262528 /* here we continue as we can send several packets per 10 ms slot */
25272529 }
@@ -3404,10 +3406,10 @@ static int rtp_new_av_stream(HTTPContext *c, · 876 unmodified lines
34043406 "rtp://%s:%d", ipaddr, ntohs(dest_addr->sin_port));
34053407 }
34063408
3407− if (url_open(&h, ctx->filename, AVIO_FLAG_WRITE) < 0)
3409+ if (ffurl_open(&h, ctx->filename, AVIO_FLAG_WRITE, NULL, NULL) < 0)
34083410 goto fail;
34093411 c->rtp_handles[stream_index] = h;
3410− max_packet_size = url_get_max_packet_size(h);
3412+ max_packet_size = h->max_packet_size;
34113413 break;
34123414 case RTSP_LOWER_TRANSPORT_TCP:
34133415 /* RTP/TCP case */
@@ -3430,7 +3432,7 @@ static int rtp_new_av_stream(HTTPContext *c, · 16 unmodified lines
34303432 if (avformat_write_header(ctx, NULL) < 0) {
34313433 fail:
34323434 if (h)
3433− url_close(h);
3435+ ffurl_close(h);
34343436 av_free(ctx);
34353437 return -1;
34363438 }
@@ -3467,7 +3469,7 @@ static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int cop · 30 unmodified lines
34673469 }
34683470 fst->priv_data = av_mallocz(sizeof(FeedData));
34693471 fst->index = stream->nb_streams;
3470− av_set_pts_info(fst, 33, 1, 90000);
3472+ avpriv_set_pts_info(fst, 33, 1, 90000);
34713473 fst->sample_aspect_ratio = codec->sample_aspect_ratio;
34723474 stream->streams[stream->nb_streams++] = fst;
34733475 return fst;
configure+1−1
@@ -1534,7 +1534,7 @@ avconv_deps="avcodec avformat swscale" · 1533 unmodified lines
15341534 avplay_deps="avcodec avformat swscale sdl"
15351535 avplay_select="rdft"
15361536 avprobe_deps="avcodec avformat"
1537−avserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
1537+avserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer !shared"
15381538 avserver_extralibs='$ldl'
15391539 ffmpeg_deps="avcodec avformat swscale"
15401540

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t