Commit 0b1af9d3 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avformat/webm_chunk: Don't use child AVFormatContext for logging

Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 00d0934f
...@@ -87,25 +87,24 @@ static int chunk_mux_init(AVFormatContext *s) ...@@ -87,25 +87,24 @@ static int chunk_mux_init(AVFormatContext *s)
static int get_chunk_filename(AVFormatContext *s, int is_header, char filename[MAX_FILENAME_SIZE]) static int get_chunk_filename(AVFormatContext *s, int is_header, char filename[MAX_FILENAME_SIZE])
{ {
WebMChunkContext *wc = s->priv_data; WebMChunkContext *wc = s->priv_data;
AVFormatContext *oc = wc->avf;
if (!filename) { if (!filename) {
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (is_header) { if (is_header) {
int len; int len;
if (!wc->header_filename) { if (!wc->header_filename) {
av_log(oc, AV_LOG_ERROR, "No header filename provided\n"); av_log(s, AV_LOG_ERROR, "No header filename provided\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
len = av_strlcpy(filename, wc->header_filename, MAX_FILENAME_SIZE); len = av_strlcpy(filename, wc->header_filename, MAX_FILENAME_SIZE);
if (len >= MAX_FILENAME_SIZE) { if (len >= MAX_FILENAME_SIZE) {
av_log(oc, AV_LOG_ERROR, "Header filename too long\n"); av_log(s, AV_LOG_ERROR, "Header filename too long\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
} else { } else {
if (av_get_frame_filename(filename, MAX_FILENAME_SIZE, if (av_get_frame_filename(filename, MAX_FILENAME_SIZE,
s->url, wc->chunk_index - 1) < 0) { s->url, wc->chunk_index - 1) < 0) {
av_log(oc, AV_LOG_ERROR, "Invalid chunk filename template '%s'\n", s->url); av_log(s, AV_LOG_ERROR, "Invalid chunk filename template '%s'\n", s->url);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment