Browse Source

flv: Index the audio stream

And leverage the video index if the video is just disabled as wm4
did in an initial patch.
tags/n2.4
Luca Barbato 11 years ago
parent
commit
fa14804c83
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      libavformat/flvdec.c

+ 5
- 2
libavformat/flvdec.c View File

@@ -818,6 +818,11 @@ skip:
st = create_stream(s, is_audio ? AVMEDIA_TYPE_AUDIO st = create_stream(s, is_audio ? AVMEDIA_TYPE_AUDIO
: AVMEDIA_TYPE_VIDEO); : AVMEDIA_TYPE_VIDEO);
av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard); av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard);

if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY ||
is_audio)
av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);

if ((st->discard >= AVDISCARD_NONKEY && if ((st->discard >= AVDISCARD_NONKEY &&
!((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY || is_audio)) || !((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY || is_audio)) ||
(st->discard >= AVDISCARD_BIDIR && (st->discard >= AVDISCARD_BIDIR &&
@@ -826,8 +831,6 @@ skip:
avio_seek(s->pb, next, SEEK_SET); avio_seek(s->pb, next, SEEK_SET);
continue; continue;
} }
if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)
av_add_index_entry(st, pos, dts, size, 0, AVINDEX_KEYFRAME);
break; break;
} }




Loading…
Cancel
Save