Merge commit 'a925f723a915bc0255e2673f8817af5212131763'

* commit 'a925f723a915bc0255e2673f8817af5212131763':
  rtp: Don't read priv_data unless it is allocated
  flvenc: Check whether seeking back to the header succeeded
  sapenc: Pass the title on to the chained muxers

Conflicts:
	libavformat/flvenc.c
	libavformat/sapenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-12-21 14:06:42 +01:00
commit 29707f5ba6
3 changed files with 5 additions and 5 deletions

View File

@ -426,11 +426,11 @@ static int flv_write_trailer(AVFormatContext *s)
file_size = avio_tell(pb);
/* update information */
if(avio_seek(pb, flv->duration_offset, SEEK_SET) < 0)
if (avio_seek(pb, flv->duration_offset, SEEK_SET) < 0)
av_log(s, AV_LOG_WARNING, "Failed to update header with correct duration.\n");
else
put_amf_double(pb, flv->duration / (double)1000);
if(avio_seek(pb, flv->filesize_offset, SEEK_SET) < 0)
if (avio_seek(pb, flv->filesize_offset, SEEK_SET) < 0)
av_log(s, AV_LOG_WARNING, "Failed to update header with correct filesize.\n");
else
put_amf_double(pb, file_size);

View File

@ -97,7 +97,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt,
AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL;
/* Was the payload type already specified for the RTP muxer? */
if (ofmt && ofmt->priv_class) {
if (ofmt && ofmt->priv_class && fmt->priv_data) {
int64_t payload_type;
if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 &&
payload_type >= 0)

View File

@ -23,6 +23,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/random_seed.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/time.h"
#include "libavutil/dict.h"
@ -160,9 +161,8 @@ static int sap_write_header(AVFormatContext *s)
av_strlcpy(contexts[i]->filename, url, sizeof(contexts[i]->filename));
}
if (s->nb_streams > 0 && title) {
if (s->nb_streams > 0 && title)
av_dict_set(&contexts[0]->metadata, "title", title->value, 0);
}
ff_url_join(url, sizeof(url), "udp", NULL, announce_addr, port,
"?ttl=%d&connect=1", ttl);