aboutsummaryrefslogtreecommitdiffhomepage
path: root/demux
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2015-06-21 16:56:35 +0200
committerGravatar wm4 <wm4@nowhere>2015-06-21 16:56:35 +0200
commit2b64eee8d5ed4ab781dcbf98654f028a6d7cef11 (patch)
tree64f498f7f15ddf5bd83e7e7b4dca6c1a38cb3cbe /demux
parent991af7dfb10c514a10d84f5a3e2698e646eb53d4 (diff)
demux: rename sh_stream.format to sh_stream.codec_tag
Why not. "format" sounds too misleading for the actual importance and meaning of this field.
Diffstat (limited to 'demux')
-rw-r--r--demux/codec_tags.c4
-rw-r--r--demux/demux_disc.c2
-rw-r--r--demux/demux_lavf.c4
-rw-r--r--demux/demux_mkv.c8
-rw-r--r--demux/demux_raw.c2
-rw-r--r--demux/demux_tv.c2
-rw-r--r--demux/stheader.h2
7 files changed, 11 insertions, 13 deletions
diff --git a/demux/codec_tags.c b/demux/codec_tags.c
index 9a0e9976c7..0b014276a5 100644
--- a/demux/codec_tags.c
+++ b/demux/codec_tags.c
@@ -72,11 +72,11 @@ static const char *map_audio_pcm_tag(uint32_t tag, int bits)
void mp_set_codec_from_tag(struct sh_stream *sh)
{
- sh->codec = lookup_tag(sh->type, sh->format);
+ sh->codec = lookup_tag(sh->type, sh->codec_tag);
if (sh->audio && sh->audio->bits_per_coded_sample) {
const char *codec =
- map_audio_pcm_tag(sh->format, sh->audio->bits_per_coded_sample);
+ map_audio_pcm_tag(sh->codec_tag, sh->audio->bits_per_coded_sample);
if (codec)
sh->codec = codec;
}
diff --git a/demux/demux_disc.c b/demux/demux_disc.c
index 3cbd01a9b8..6a9220189c 100644
--- a/demux/demux_disc.c
+++ b/demux/demux_disc.c
@@ -141,7 +141,7 @@ static void add_streams(demuxer_t *demuxer)
MP_TARRAY_APPEND(p, p->streams, p->num_streams, sh);
// Copy all stream fields that might be relevant
sh->codec = talloc_strdup(sh, src->codec);
- sh->format = src->format;
+ sh->codec_tag = src->codec_tag;
sh->lav_headers = src->lav_headers;
sh->demuxer_id = src->demuxer_id;
if (src->video) {
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 943fb1d8af..608bf0e03c 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -521,8 +521,6 @@ static void handle_stream(demuxer_t *demuxer, int i)
break;
sh_audio_t *sh_audio = sh->audio;
- sh->format = codec->codec_tag;
-
// probably unneeded
mp_chmap_set_unknown(&sh_audio->channels, codec->channels);
if (codec->channel_layout)
@@ -550,7 +548,6 @@ static void handle_stream(demuxer_t *demuxer, int i)
}
}
- sh->format = codec->codec_tag;
sh_video->disp_w = codec->width;
sh_video->disp_h = codec->height;
/* Try to make up some frame rate value, even if it's not reliable.
@@ -636,6 +633,7 @@ static void handle_stream(demuxer_t *demuxer, int i)
if (sh) {
sh->ff_index = st->index;
sh->codec = mp_codec_from_av_codec_id(codec->codec_id);
+ sh->codec_tag = codec->codec_tag;
sh->lav_headers = codec;
if (st->disposition & AV_DISPOSITION_DEFAULT)
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index bd76702238..b6474c970f 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -1238,7 +1238,7 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track)
if (track->v_height == 0)
track->v_height = AV_RL32(h + 8); // biHeight
sh_v->bits_per_coded_sample = AV_RL16(h + 14); // biBitCount
- sh->format = AV_RL32(h + 16); // biCompression
+ sh->codec_tag = AV_RL32(h + 16); // biCompression
extradata = track->private_data + 40;
extradata_size = track->private_size - 40;
@@ -1270,7 +1270,7 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track)
track->parse_timebase = 1e3;
} else if (strcmp(track->codec_id, "V_UNCOMPRESSED") == 0) {
// raw video, "like AVI" - this is a FourCC
- sh->format = track->colorspace;
+ sh->codec_tag = track->colorspace;
sh->codec = "rawvideo";
} else if (strcmp(track->codec_id, "V_QUICKTIME") == 0) {
uint32_t fourcc1 = 0, fourcc2 = 0;
@@ -1302,7 +1302,7 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track)
track->parse = true;
track->parse_timebase = 1e9;
} else if (!strcmp(codec, "mjpeg")) {
- sh->format = MP_FOURCC('m', 'j', 'p', 'g');
+ sh->codec_tag = MP_FOURCC('m', 'j', 'p', 'g');
}
if (extradata_size > 0x1000000) {
@@ -1391,7 +1391,7 @@ static int demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track)
goto error;
MP_VERBOSE(demuxer, "track with MS compat audio.\n");
unsigned char *h = track->private_data;
- sh->format = AV_RL16(h + 0); // wFormatTag
+ sh->codec_tag = AV_RL16(h + 0); // wFormatTag
if (track->a_channels == 0)
track->a_channels = AV_RL16(h + 2); // nChannels
if (sh_a->samplerate == 0)
diff --git a/demux/demux_raw.c b/demux/demux_raw.c
index 65d6b754be..a67287792b 100644
--- a/demux/demux_raw.c
+++ b/demux/demux_raw.c
@@ -222,7 +222,7 @@ static int demux_rawvideo_open(demuxer_t *demuxer, enum demux_check check)
sh = new_sh_stream(demuxer, STREAM_VIDEO);
sh_video = sh->video;
sh->codec = decoder;
- sh->format = imgfmt;
+ sh->codec_tag = imgfmt;
sh_video->fps = opts->fps;
sh_video->disp_w = width;
sh_video->disp_h = height;
diff --git a/demux/demux_tv.c b/demux/demux_tv.c
index 198ca922e5..ab584874cb 100644
--- a/demux/demux_tv.c
+++ b/demux/demux_tv.c
@@ -60,7 +60,7 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check)
sh_v->codec = "mjpeg";
} else {
sh_v->codec = "rawvideo";
- sh_v->format = fourcc;
+ sh_v->codec_tag = fourcc;
}
/* set FPS and FRAMETIME */
diff --git a/demux/stheader.h b/demux/stheader.h
index 444f2f3e34..ae346ee8d0 100644
--- a/demux/stheader.h
+++ b/demux/stheader.h
@@ -47,7 +47,7 @@ struct sh_stream {
const char *codec;
// Usually a FourCC, exact meaning depends on codec.
- unsigned int format;
+ unsigned int codec_tag;
// Codec specific header data (set by demux_lavf.c only)
struct AVCodecContext *lav_headers;