summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-02 20:48:01 +0100
committerwm4 <wm4@nowhere>2013-02-03 16:44:41 +0100
commitd61408f0da9086883ba71b74c60dd998986ebd19 (patch)
tree4b19bc4761179e64e7d739ad44d53d9f9bade5ca /demux/demux_lavf.c
parent74b66862d776f81a6da374b7e6cc54d2d5e8e16e (diff)
downloadmpv-d61408f0da9086883ba71b74c60dd998986ebd19.tar.bz2
mpv-d61408f0da9086883ba71b74c60dd998986ebd19.tar.xz
demux_lavf: remove "internet radio hack"
It appears this is not needed anymore. ffmpeg can handle "chained" ogg files fine. These can be created with "cat file1.ogg file2.ogg > chained.ogg", and are similar (or equal) to some internet radio streams. Apparently ffmpeg used to add new tracks when crossing boundaries in chained files, and the hack in demux_lavf.c handled this. At some later point, ffmpeg's ogg demuxer was improved, and stopped adding new tracks as long as the codec doesn't change. Since the hack in demux_lavf.c was hardcoded to Vorbis (i.e. only active if the new and old track were both Vorbis), it's dead code, and we can remove it. I couldn't find any stream that triggered this hack, or fails without it. Firefox had a similar issue, and its bug tracker makes a good reference: https://bugzilla.mozilla.org/show_bug.cgi?id=455165 NOTE: this doesn't update metadata on track changes anymore.
Diffstat (limited to 'demux/demux_lavf.c')
-rw-r--r--demux/demux_lavf.c40
1 files changed, 1 insertions, 39 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c
index 2ace2be203..1d03d3f217 100644
--- a/demux/demux_lavf.c
+++ b/demux/demux_lavf.c
@@ -79,7 +79,6 @@ typedef struct lavf_priv {
int sstreams[MAX_S_STREAMS];
int cur_program;
int nb_streams_last;
- bool internet_radio_hack;
bool use_dts;
bool seek_by_bytes;
int bitrate;
@@ -744,42 +743,6 @@ static demuxer_t *demux_open_lavf(demuxer_t *demuxer)
return demuxer;
}
-static void check_internet_radio_hack(struct demuxer *demuxer)
-{
- struct lavf_priv *priv = demuxer->priv;
- struct AVFormatContext *avfc = priv->avfc;
-
- if (!matches_avinputformat_name(priv, "ogg"))
- return;
- if (priv->nb_streams_last == avfc->nb_streams)
- return;
- if (avfc->nb_streams - priv->nb_streams_last == 1
- && priv->video_streams == 0 && priv->sub_streams == 0
- && demuxer->a_streams[priv->audio_streams - 1]->format == 0x566f // vorbis
- && (priv->audio_streams == 2 || priv->internet_radio_hack)
- && demuxer->a_streams[0]->format == 0x566f) {
- // extradata match could be checked but would require parsing
- // headers, as the comment section will vary
- if (!priv->internet_radio_hack) {
- mp_msg(MSGT_DEMUX, MSGL_V,
- "[lavf] enabling internet ogg radio hack\n");
- }
- priv->internet_radio_hack = true;
- // use new per-track metadata as global metadata
- AVDictionaryEntry *t = NULL;
- AVStream *stream = avfc->streams[avfc->nb_streams - 1];
- while ((t = av_dict_get(stream->metadata, "", t,
- AV_DICT_IGNORE_SUFFIX)))
- demux_info_add(demuxer, t->key, t->value);
- } else {
- if (priv->internet_radio_hack)
- mp_tmsg(MSGT_DEMUX, MSGL_WARN, "[lavf] Internet radio ogg hack "
- "was enabled, but stream characteristics changed.\n"
- "This may or may not work.\n");
- priv->internet_radio_hack = false;
- }
-}
-
static int destroy_avpacket(void *pkt)
{
av_free_packet(pkt);
@@ -806,7 +769,6 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds)
// handle any new streams that might have been added
for (id = priv->nb_streams_last; id < priv->avfc->nb_streams; id++)
handle_stream(demux, priv->avfc, id);
- check_internet_radio_hack(demux);
priv->nb_streams_last = priv->avfc->nb_streams;
@@ -820,7 +782,7 @@ static int demux_lavf_fill_buffer(demuxer_t *demux, demux_stream_t *dsds)
demux->sub->id = id;
}
- if (id == demux->audio->id || priv->internet_radio_hack) {
+ if (id == demux->audio->id) {
// audio
ds = demux->audio;
if (!ds->sh) {