Merge remote-tracking branch 'qatar/master'
[ffmpeg.git] / libavformat / utils.c
index 9a7d6b7..58b1f56 100644 (file)
@@ -3122,8 +3122,9 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
         return ret;
 
     ret= s->oformat->write_packet(s, pkt);
-    if(!ret)
-        ret= url_ferror(s->pb);
+
+    if (ret >= 0)
+        s->streams[pkt->stream_index]->nb_frames++;
     return ret;
 }
 
@@ -3244,6 +3245,8 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
             return ret;
 
         ret= s->oformat->write_packet(s, &opkt);
+        if (ret >= 0)
+            s->streams[opkt.stream_index]->nb_frames++;
 
         av_free_packet(&opkt);
         pkt= NULL;
@@ -3268,6 +3271,8 @@ int av_write_trailer(AVFormatContext *s)
             break;
 
         ret= s->oformat->write_packet(s, &pkt);
+        if (ret >= 0)
+            s->streams[pkt.stream_index]->nb_frames++;
 
         av_free_packet(&pkt);