diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:58:15 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:59:55 +0100 |
commit | 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch) | |
tree | 0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/assenc.c | |
parent | 60b75186b2c878b6257b43c8fcc0b1356ada218e (diff) | |
parent | 9200514ad8717c63f82101dc394f4378854325bf (diff) | |
download | ffmpeg-6f69f7a8bf6a0d013985578df2ef42ee6b1c7994.tar.gz |
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
lavf: replace AVStream.codec with AVStream.codecpar
This has been a HUGE effort from:
- Derek Buitenhuis <derek.buitenhuis@gmail.com>
- Hendrik Leppkes <h.leppkes@gmail.com>
- wm4 <nfxjfg@googlemail.com>
- Clément Bœsch <clement@stupeflix.com>
- James Almer <jamrial@gmail.com>
- Michael Niedermayer <michael@niedermayer.cc>
- Rostislav Pehlivanov <atomnuker@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/assenc.c')
-rw-r--r-- | libavformat/assenc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libavformat/assenc.c b/libavformat/assenc.c index 9a107aab7c..d50f18feb1 100644 --- a/libavformat/assenc.c +++ b/libavformat/assenc.c @@ -46,16 +46,16 @@ typedef struct ASSContext { static int write_header(AVFormatContext *s) { ASSContext *ass = s->priv_data; - AVCodecContext *avctx = s->streams[0]->codec; + AVCodecParameters *par = s->streams[0]->codecpar; - if (s->nb_streams != 1 || avctx->codec_id != AV_CODEC_ID_ASS) { + if (s->nb_streams != 1 || par->codec_id != AV_CODEC_ID_ASS) { av_log(s, AV_LOG_ERROR, "Exactly one ASS/SSA stream is needed.\n"); return AVERROR(EINVAL); } avpriv_set_pts_info(s->streams[0], 64, 1, 100); - if (avctx->extradata_size > 0) { - size_t header_size = avctx->extradata_size; - uint8_t *trailer = strstr(avctx->extradata, "\n[Events]"); + if (par->extradata_size > 0) { + size_t header_size = par->extradata_size; + uint8_t *trailer = strstr(par->extradata, "\n[Events]"); if (trailer) trailer = strstr(trailer, "Format:"); @@ -63,17 +63,17 @@ static int write_header(AVFormatContext *s) trailer = strstr(trailer, "\n"); if (trailer++) { - header_size = (trailer - avctx->extradata); - ass->trailer_size = avctx->extradata_size - header_size; + header_size = (trailer - par->extradata); + ass->trailer_size = par->extradata_size - header_size; if (ass->trailer_size) ass->trailer = trailer; } - avio_write(s->pb, avctx->extradata, header_size); - if (avctx->extradata[header_size - 1] != '\n') + avio_write(s->pb, par->extradata, header_size); + if (par->extradata[header_size - 1] != '\n') avio_write(s->pb, "\r\n", 2); - ass->ssa_mode = !strstr(avctx->extradata, "\n[V4+ Styles]"); - if (!strstr(avctx->extradata, "\n[Events]")) + ass->ssa_mode = !strstr(par->extradata, "\n[V4+ Styles]"); + if (!strstr(par->extradata, "\n[Events]")) avio_printf(s->pb, "[Events]\r\nFormat: %s, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n", ass->ssa_mode ? "Marked" : "Layer"); } |