diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-11-11 20:44:28 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-11-14 20:38:51 +0100 |
commit | 8034130e06b03859af9ce64f7ee653cd14df328d (patch) | |
tree | ac5d06c32f27347f96c147599f2e6129178c6e1e /libavformat/movenc.c | |
parent | 3b4296f41473a5b39e84d7a49d480624c9c60040 (diff) | |
download | ffmpeg-8034130e06b03859af9ce64f7ee653cd14df328d.tar.gz |
rtp: set the payload type as stream id
Support multiple video/audio streams with different format in the
same session.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 50371cda96..39495203df 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1536,13 +1536,16 @@ static int mov_write_uuid_tag_psp(AVIOContext *pb, MOVTrack *mov) return 0x34; } -static int mov_write_udta_sdp(AVIOContext *pb, AVFormatContext *ctx, int index) +static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track) { + + AVFormatContext *ctx = track->rtp_ctx; char buf[1000] = ""; int len; - ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0]->codec, NULL, NULL, 0, 0, ctx); - av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", index); + ff_sdp_write_media(buf, sizeof(buf), ctx->streams[0], track->src_track, + NULL, NULL, 0, 0, ctx); + av_strlcatf(buf, sizeof(buf), "a=control:streamid=%d\r\n", track->track_id); len = strlen(buf); avio_wb32(pb, len + 24); @@ -1573,7 +1576,7 @@ static int mov_write_trak_tag(AVIOContext *pb, MOVMuxContext *mov, if (track->mode == MODE_PSP) mov_write_uuid_tag_psp(pb,track); // PSP Movies require this uuid box if (track->tag == MKTAG('r','t','p',' ')) - mov_write_udta_sdp(pb, track->rtp_ctx, track->track_id); + mov_write_udta_sdp(pb, track); if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && track->mode == MODE_MOV) { double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio); if (0.0 != sample_aspect_ratio && 1.0 != sample_aspect_ratio) |