Merge remote-tracking branch 'upstream/master'

This commit is contained in:
antma 2014-01-20 12:57:20 +04:00
commit 49618453fa
4 changed files with 20 additions and 3 deletions

View File

@ -971,7 +971,7 @@ void interpreter (char *line UU) {
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_audio) { if (M && !M->service && M->media.type == (int)CODE_message_media_audio) {
do_load_video (&M->media.video, 1); do_load_audio (&M->media.video, 1);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_audio) { } else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_audio) {
do_load_encr_video (&M->media.encr_video, 1); do_load_encr_video (&M->media.encr_video, 1);
} else { } else {
@ -986,7 +986,7 @@ void interpreter (char *line UU) {
} }
struct message *M = message_get (num); struct message *M = message_get (num);
if (M && !M->service && M->media.type == (int)CODE_message_media_audio) { if (M && !M->service && M->media.type == (int)CODE_message_media_audio) {
do_load_video (&M->media.video, 2); do_load_audio (&M->media.video, 2);
} else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_audio) { } else if (M && !M->service && M->media.type == (int)CODE_decrypted_message_media_audio) {
do_load_encr_video (&M->media.encr_video, 2); do_load_encr_video (&M->media.encr_video, 2);
} else { } else {

View File

@ -343,7 +343,7 @@ static int pos;
static peer_t *get_peer (const char *s) { static peer_t *get_peer (const char *s) {
int index = 0; int index = 0;
while (index < peer_num && Peers[index]->print_name && strcmp (Peers[index]->print_name, s)) { while (index < peer_num && (!Peers[index]->print_name || strcmp (Peers[index]->print_name, s))) {
index ++; index ++;
} }
return index == peer_num ? 0 : Peers[index]; return index == peer_num ? 0 : Peers[index];

View File

@ -1936,6 +1936,22 @@ void do_load_video (struct video *V, int next) {
load_next_part (D); load_next_part (D);
} }
void do_load_audio (struct video *V, int next) {
assert (V);
assert (next);
struct download *D = talloc0 (sizeof (*D));
D->offset = 0;
D->size = V->size;
D->id = V->id;
D->access_hash = V->access_hash;
D->dc = V->dc_id;
D->next = next;
D->name = 0;
D->fd = -1;
D->type = CODE_input_audio_file_location;
load_next_part (D);
}
void do_load_document (struct document *V, int next) { void do_load_document (struct document *V, int next) {
assert (V); assert (V);
assert (next); assert (next);

View File

@ -89,6 +89,7 @@ struct photo;
struct video; struct video;
void do_load_photo (struct photo *photo, int next); void do_load_photo (struct photo *photo, int next);
void do_load_video_thumb (struct video *video, int next); void do_load_video_thumb (struct video *video, int next);
void do_load_audio (struct video *V, int next);
void do_load_video (struct video *V, int next); void do_load_video (struct video *V, int next);
void do_load_document (struct document *V, int next); void do_load_document (struct document *V, int next);
void do_load_document_thumb (struct document *video, int next); void do_load_document_thumb (struct document *video, int next);