static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack* track) // Basic
{
- int decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0;
+ int decoderSpecificInfoLen;
int pos = url_ftell(pb);
void *vosDataBackup=track->vosData;
int vosLenBackup=track->vosLen;
}
}
+ decoderSpecificInfoLen = track->vosLen ? descrLength(track->vosLen):0;
+
put_be32(pb, 0); // size
put_tag(pb, "esds");
put_be32(pb, 0); // Version
put_be16(pb, 1); /* Frame count (= 1) */
memset(compressor_name,0,32);
- if (track->enc->codec->name)
+ if (track->enc->codec && track->enc->codec->name)
strncpy(compressor_name,track->enc->codec->name,31);
- put_byte(pb, FFMAX(strlen(compressor_name),32) );
+ put_byte(pb, strlen(compressor_name));
put_buffer(pb, compressor_name, 31);
put_be16(pb, 0x18); /* Reserved */
return 0x14;
}
-int mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s)
+static void mov_write_uuidprof_tag(ByteIOContext *pb, AVFormatContext *s)
{
- MOVContext *mov = s->priv_data;
int AudioRate = s->streams[1]->codec.sample_rate;
int FrameRate = ((s->streams[0]->codec.frame_rate) * (0x10000))/ (s->streams[0]->codec.frame_rate_base);
put_be16(pb, s->streams[0]->codec.width);
put_be16(pb, s->streams[0]->codec.height);
put_be32(pb, 0x010001 );
-
- return 0x94;
}
static int mov_write_header(AVFormatContext *s)
if ( mov->mode == MODE_3GP || mov->mode == MODE_MP4 || mov->mode == MODE_PSP )
mov_write_ftyp_tag(pb,s);
- if ( mov->mode == MODE_PSP )
+ if ( mov->mode == MODE_PSP ) {
+ if ( s->nb_streams != 2 ) {
+ av_log(s, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n");
+ return -1;
+ }
mov_write_uuidprof_tag(pb,s);
+ }
}
for (i=0; i<MAX_STREAMS; i++) {