]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/matroskaenc.c
avcodec: Implementation of AAC_fixed_decoder (SBR-module)
[ffmpeg] / libavformat / matroskaenc.c
index 3b525ad4d4dfd2afe98a7f5bdbd21f9015bcac38..2d0d5f6bb1b4ae4f737419cb11379ccb13ad18f0 100644 (file)
@@ -1772,7 +1772,7 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_
 
     if (codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
         mkv_write_block(s, pb, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe);
-        if (codec->codec_type == AVMEDIA_TYPE_VIDEO && keyframe || add_cue) {
+        if (s->pb->seekable && (codec->codec_type == AVMEDIA_TYPE_VIDEO && keyframe || add_cue)) {
             ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, dash_tracknum, ts, mkv->cluster_pos, relative_packet_pos, -1);
             if (ret < 0) return ret;
         }
@@ -1792,10 +1792,12 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt, int add_
         end_ebml_master(pb, blockgroup);
     }
 
-    ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, dash_tracknum, ts,
-                           mkv->cluster_pos, relative_packet_pos, duration);
-    if (ret < 0)
-        return ret;
+    if (s->pb->seekable) {
+        ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, dash_tracknum, ts,
+                               mkv->cluster_pos, relative_packet_pos, duration);
+        if (ret < 0)
+            return ret;
+        }
     }
 
     mkv->duration = FFMAX(mkv->duration, ts + duration);